Skip to content

Commit

Permalink
Merge pull request #26771 from software-mansion-labs/ts-migration/sta…
Browse files Browse the repository at this point in the history
…rtup-timer-lib

[No QA] [TS migration] Migrate 'StartupTimer' lib to TypeScript
  • Loading branch information
pecanoro authored Sep 12, 2023
2 parents 06356cb + ee1bd67 commit c7f1f3d
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 19 deletions.
7 changes: 0 additions & 7 deletions src/libs/StartupTimer/index.js

This file was deleted.

12 changes: 0 additions & 12 deletions src/libs/StartupTimer/index.native.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/libs/StartupTimer/index.native.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {NativeModules} from 'react-native';
import StartupTimer from './types';

/**
* Stop the startup trace for the app.
*/
const startupTimer: StartupTimer = {
stop: () => {
NativeModules.StartupTimer.stop();
},
};

export default startupTimer;
11 changes: 11 additions & 0 deletions src/libs/StartupTimer/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Web noop as there is no "startup" to time from the native layer.
*/

import StartupTimer from './types';

const startupTimer: StartupTimer = {
stop: () => {},
};

export default startupTimer;
5 changes: 5 additions & 0 deletions src/libs/StartupTimer/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type StartupTimer = {
stop: () => void;
};

export default StartupTimer;

0 comments on commit c7f1f3d

Please sign in to comment.