aboutsummaryrefslogtreecommitdiff
path: root/paste-ui/src/reportWebVitals.js
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@riedstra.dev>2022-12-26 00:11:58 -0500
committerMitchell Riedstra <mitch@riedstra.dev>2022-12-26 00:11:58 -0500
commitfd3e3280a2590be9ca074a172c535990a5035649 (patch)
tree232f23010449a5aea88052c6e860a68ef9bdeb34 /paste-ui/src/reportWebVitals.js
parent0704674ba408db54855c33bcb8ca71a7ae1e74b7 (diff)
downloadpaste-fd3e3280a2590be9ca074a172c535990a5035649.tar.gz
paste-fd3e3280a2590be9ca074a172c535990a5035649.tar.xz
Add a proxy option for static assets. Fix the paste view handlers.
Diffstat (limited to 'paste-ui/src/reportWebVitals.js')
-rw-r--r--paste-ui/src/reportWebVitals.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/paste-ui/src/reportWebVitals.js b/paste-ui/src/reportWebVitals.js
new file mode 100644
index 0000000..5253d3a
--- /dev/null
+++ b/paste-ui/src/reportWebVitals.js
@@ -0,0 +1,13 @@
+const reportWebVitals = onPerfEntry => {
+ 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;