You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
440 B

4 years ago
  1. import { ReportHandler } from 'web-vitals';
  2. const reportWebVitals = (onPerfEntry?: ReportHandler) => {
  3. if (onPerfEntry && onPerfEntry instanceof Function) {
  4. import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
  5. getCLS(onPerfEntry);
  6. getFID(onPerfEntry);
  7. getFCP(onPerfEntry);
  8. getLCP(onPerfEntry);
  9. getTTFB(onPerfEntry);
  10. });
  11. }
  12. };
  13. export default reportWebVitals;