Skip to content

Commit

Permalink
refactor: use on prefix methods
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya01 committed Jun 10, 2022
1 parent c2f7827 commit f1175e0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/webVitals.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
FirstInputPolyfillEntry,
getCLS,
getFID,
getLCP,
getTTFB,
onCLS,
onFID,
onLCP,
onTTFB,
onINP,
ReportHandler as WebVitalsReportHandler,
Metric as WebVitalsMetrics,
Expand Down Expand Up @@ -142,7 +142,7 @@ export const reportCLS: Report = (report) => {
rectDiff,
});
};
getCLS(handleReportHandler(reportHandler));
onCLS(handleReportHandler(reportHandler));
};

export const reportLCP: Report = (report) => {
Expand All @@ -163,7 +163,7 @@ export const reportLCP: Report = (report) => {
});
});
};
getLCP(handleReportHandler(reportHandler));
onLCP(handleReportHandler(reportHandler));
};

export const reportFID: Report = (report) => {
Expand All @@ -185,7 +185,7 @@ export const reportFID: Report = (report) => {
});
};

getFID(handleReportHandler(reportHandler));
onFID(handleReportHandler(reportHandler));
};

export const reportTTFB: Report = (report) => {
Expand All @@ -200,7 +200,7 @@ export const reportTTFB: Report = (report) => {
networkType: getNetworkType(),
});
};
getTTFB(handleReportHandler(reportHandler));
onTTFB(handleReportHandler(reportHandler));
};

export const reportINP: Report<ReportOpts> = (report, option) => {
Expand Down

0 comments on commit f1175e0

Please sign in to comment.