summaryrefslogtreecommitdiff
path: root/front/src/reportWebVitals.ts
diff options
context:
space:
mode:
authorphyscik <mynameisgennadiy@vk.com>2026-04-10 20:45:57 +0500
committerphyscik <mynameisgennadiy@vk.com>2026-04-10 20:45:57 +0500
commite243f101b3266ed98a1b668562a639408ffe36d7 (patch)
tree9476be3e45f39c1a07655607002a41a914daf7e3 /front/src/reportWebVitals.ts
parentfd5b5fedfec1921930257b1003245f3740536556 (diff)
router setup
Diffstat (limited to 'front/src/reportWebVitals.ts')
-rw-r--r--front/src/reportWebVitals.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/front/src/reportWebVitals.ts b/front/src/reportWebVitals.ts
new file mode 100644
index 0000000..49a2a16
--- /dev/null
+++ b/front/src/reportWebVitals.ts
@@ -0,0 +1,15 @@
+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;