1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
botw-hundo-dupl/src/reportWebVitals.ts

16 lines
404 B
TypeScript
Raw Normal View History

2022-06-20 05:09:39 +09:00
import { ReportHandler } from "web-vitals";
2022-06-19 19:52:08 +09:00
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
2022-06-20 05:09:39 +09:00
if (onPerfEntry && onPerfEntry instanceof Function) {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}
2022-06-19 19:52:08 +09:00
};
export default reportWebVitals;