Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 18 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { ReportHandler } from 'web-vitals'; |
||
2 | |||
3 | const reportWebVitals = (onPerfEntry?: ReportHandler): void => { |
||
4 | if (onPerfEntry && onPerfEntry instanceof Function) { |
||
5 | import('web-vitals').then(({ |
||
6 | getCLS, getFID, getFCP, getLCP, getTTFB, |
||
7 | }) => { |
||
8 | getCLS(onPerfEntry); |
||
9 | getFID(onPerfEntry); |
||
10 | getFCP(onPerfEntry); |
||
11 | getLCP(onPerfEntry); |
||
12 | getTTFB(onPerfEntry); |
||
13 | }); |
||
14 | } |
||
15 | }; |
||
16 | |||
17 | export default reportWebVitals; |
||
18 |