small modifications

This commit is contained in:
Artur Tamborski 2020-11-27 18:59:55 +01:00
parent e08480bb18
commit 6468f94c61
3 changed files with 12 additions and 17 deletions

View File

@ -1,15 +1,14 @@
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 function reportWebVitals(onPerfEntry?: ReportHandler) {
if (!onPerfEntry)
return;
export default reportWebVitals;
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry);
getFID(onPerfEntry);
getFCP(onPerfEntry);
getLCP(onPerfEntry);
getTTFB(onPerfEntry);
});
}

View File

@ -1,5 +1 @@
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom';

View File

@ -21,7 +21,7 @@
"sourceMap": true,
"declaration": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
// "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"incremental": true
},