mirror of
https://github.com/quantum5/qcal.git
synced 2025-04-24 09:41:57 -04:00
Factor out reportWebVitals.ts
This commit is contained in:
parent
766a222979
commit
caa0a02a0a
|
@ -1,4 +1,4 @@
|
|||
import { ReportHandler } from 'web-vitals';
|
||||
import {ReportHandler} from 'web-vitals';
|
||||
|
||||
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
||||
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
|
|||
import 'bootstrap/js/dist/collapse';
|
||||
import './index.scss';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import reportWebVitals from '@common/ui/reportWebVitals';
|
||||
import {MobileTooltipProvider} from '@common/ui/MobileTooltip';
|
||||
|
||||
ReactDOM.render(
|
||||
|
|
|
@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
|
|||
import 'bootstrap/js/dist/collapse';
|
||||
import './index.scss';
|
||||
import App from './App';
|
||||
import reportWebVitals from './reportWebVitals';
|
||||
import reportWebVitals from '@common/ui/reportWebVitals';
|
||||
import {MobileTooltipProvider} from '@common/ui/MobileTooltip';
|
||||
|
||||
ReactDOM.render(
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
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 reportWebVitals;
|
Loading…
Reference in a new issue