14 lines
367 B
TypeScript
14 lines
367 B
TypeScript
const reportWebVitals = (onPerfEntry?: () => void) => {
|
|
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
import("web-vitals").then(({ onCLS, onINP, onFCP, onLCP, onTTFB }) => {
|
|
onCLS(onPerfEntry);
|
|
onINP(onPerfEntry);
|
|
onFCP(onPerfEntry);
|
|
onLCP(onPerfEntry);
|
|
onTTFB(onPerfEntry);
|
|
});
|
|
}
|
|
};
|
|
|
|
export default reportWebVitals;
|