-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27022 from software-mansion-labs/ts-migration/Met…
…rics [No QA][TS migration] Migrate 'Metrics' lib to TypeScript
- Loading branch information
Showing
5 changed files
with
27 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import CONFIG from '../../CONFIG'; | ||
import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; | ||
|
||
/** | ||
* Is capturing performance stats enabled. | ||
*/ | ||
const canCapturePerformanceMetrics: CanCapturePerformanceMetrics = () => CONFIG.CAPTURE_METRICS; | ||
|
||
/** | ||
* Is capturing Onyx stats enabled. | ||
*/ | ||
const canCaptureOnyxMetrics: CanCaptureOnyxMetrics = () => CONFIG.ONYX_METRICS; | ||
|
||
export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import CONFIG from '../../CONFIG'; | ||
import {CanCaptureOnyxMetrics, CanCapturePerformanceMetrics} from './types'; | ||
|
||
// We don't capture performance metrics on web as there are enough tools available | ||
const canCapturePerformanceMetrics: CanCapturePerformanceMetrics = () => false; | ||
|
||
const canCaptureOnyxMetrics: CanCaptureOnyxMetrics = () => CONFIG.ONYX_METRICS; | ||
|
||
export {canCapturePerformanceMetrics, canCaptureOnyxMetrics}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
type CanCapturePerformanceMetrics = () => boolean; | ||
type CanCaptureOnyxMetrics = () => boolean; | ||
|
||
export type {CanCapturePerformanceMetrics, CanCaptureOnyxMetrics}; |