Passed
Push — master ( 322dc8...675a3d )
by Daniel
04:11 queued 02:17
created

src/reportWebVitals.ts   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 18
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 13
mnd 1
bc 1
fnc 0
dl 0
loc 18
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
rs 10
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