Skip to content

Commit 64a1498

Browse files
authored
feat: clearResourceTimings (#122)
1 parent 311a199 commit 64a1498

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/react-native-performance/src/performance.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ export const createPerformance = (now: () => number = defaultNow) => {
8181

8282
const clearMetrics = (name?: string) => removeEntries('metric', name);
8383

84+
const clearResourceTimings = (name?: string) =>
85+
removeEntries('resource', name);
86+
8487
const convertMarkToTimestamp = (markOrTimestamp: string | number) => {
8588
switch (typeof markOrTimestamp) {
8689
case 'string': {
@@ -260,6 +263,7 @@ export const createPerformance = (now: () => number = defaultNow) => {
260263
clearMeasures,
261264
metric,
262265
clearMetrics,
266+
clearResourceTimings,
263267
getEntries,
264268
getEntriesByName,
265269
getEntriesByType,

0 commit comments

Comments
 (0)