mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-05-03 01:23:07 +00:00
16 lines
424 B
TypeScript
16 lines
424 B
TypeScript
import type { Metric } from "web-vitals";
|
|
|
|
const reportWebVitals = (onPerfEntry?: (metric: Metric) => void) => {
|
|
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
import("web-vitals").then(({ onCLS, onFCP, onLCP, onTTFB, onINP }) => {
|
|
onCLS(onPerfEntry);
|
|
onFCP(onPerfEntry);
|
|
onLCP(onPerfEntry);
|
|
onTTFB(onPerfEntry);
|
|
onINP(onPerfEntry);
|
|
});
|
|
}
|
|
};
|
|
|
|
export default reportWebVitals;
|