Created
April 14, 2023 04:52
-
-
Save thangman22/592f57fefa045c205f6c0b62b7b35667 to your computer and use it in GitHub Desktop.
inp.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use the attribution build: | |
import { onINP } from "web-vitals/attribution"; | |
// Example reporting function that's passed to web-vitals: | |
const report = ({ name, value, attribution }) => { | |
console.log(name); | |
console.log(value); | |
console.log(attribution.eventType); | |
console.log(attribution.eventTarget); | |
}; | |
// Pass the reporting function to the INP reporter: | |
onINP(report); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment