MCPcopy Create free account
hub / github.com/SuboptimalEng/coding-tutorials / reportWebVitals

Function reportWebVitals

react-redux-todo/src/reportWebVitals.ts:3–13  ·  view source on GitHub ↗
(onPerfEntry?: ReportHandler)

Source from the content-addressed store, hash-verified

1import { ReportHandler } from 'web-vitals';
2
3const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4 if (onPerfEntry && onPerfEntry instanceof Function) {
5 import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6 getCLS(onPerfEntry);
7 getFID(onPerfEntry);
8 getFCP(onPerfEntry);
9 getLCP(onPerfEntry);
10 getTTFB(onPerfEntry);
11 });
12 }
13};
14
15export default reportWebVitals;

Callers 1

index.tsxFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected