mirror of
https://github.com/xlorepdarkhelm/numinar-coding-project.git
synced 2026-09-08 00:38:24 -04:00
23 lines
559 B
TypeScript
23 lines
559 B
TypeScript
/**
|
|
* reportWebVitals.ts
|
|
* Web Vitals performance reporting for React app.
|
|
*
|
|
* Author: Cliff Hill
|
|
* Last updated: 2025-09-08
|
|
*/
|
|
import { ReportHandler } from "web-vitals";
|
|
|
|
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
|
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
|
|
getCLS(onPerfEntry);
|
|
getFID(onPerfEntry);
|
|
getFCP(onPerfEntry);
|
|
getLCP(onPerfEntry);
|
|
getTTFB(onPerfEntry);
|
|
});
|
|
}
|
|
};
|
|
|
|
export default reportWebVitals;
|