Passed
Push — main ( cafa69...3c9e73 )
by Andrii
02:00
created

__recipes__/create-react-app/src/reportWebVitals.ts   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 16
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 12
mnd 1
bc 1
fnc 0
dl 0
loc 16
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) => {
4
  if (onPerfEntry && onPerfEntry instanceof Function) {
5
    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
      getCLS(onPerfEntry);
7
      getFID(onPerfEntry);
8
      getFCP(onPerfEntry);
9
      getLCP(onPerfEntry);
10
      getTTFB(onPerfEntry);
11
    });
12
  }
13
};
14
15
export default reportWebVitals;
16