Files
conference-room-booking-system/frontend/src/reportWebVitals.ts
2025-09-09 12:54:35 -04:00

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;