This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
version.tribalwarshelp.com/src/reportWebVitals.ts
2020-11-01 15:19:49 +01:00

16 lines
426 B
TypeScript

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;