mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2025-02-28 22:43:38 +01:00
22 lines
660 B
TypeScript
22 lines
660 B
TypeScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
import { ReportHandler } from 'web-vitals';
|
|
|
|
const reportWebVitals = (onPerfEntry?: ReportHandler) => {
|
|
if (onPerfEntry) {
|
|
import('web-vitals').then(({
|
|
getCLS, getFID, getFCP, getLCP, getTTFB,
|
|
}) => {
|
|
getCLS(onPerfEntry);
|
|
getFID(onPerfEntry);
|
|
getFCP(onPerfEntry);
|
|
getLCP(onPerfEntry);
|
|
getTTFB(onPerfEntry);
|
|
});
|
|
}
|
|
};
|
|
|
|
export default reportWebVitals;
|