1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-24 14:04:19 +00:00
pds-2021-g2-nest/nest_frontend/reportWebVitals.js

14 lines
395 B
JavaScript
Raw Normal View History

2021-04-20 22:07:39 +00:00
const reportWebVitals = onPerfEntry => {
2021-04-20 22:09:13 +00:00
if(onPerfEntry && onPerfEntry instanceof Function) {
import("web-vitals").then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
getCLS(onPerfEntry)
getFID(onPerfEntry)
getFCP(onPerfEntry)
getLCP(onPerfEntry)
getTTFB(onPerfEntry)
})
}
}
2021-04-20 22:07:39 +00:00
2021-04-20 22:09:13 +00:00
export default reportWebVitals