Skip to content

Commit

Permalink
Add a note about when to load the library (#305)
Browse files Browse the repository at this point in the history
* Add a note about when to load the library

* Update README.md

Co-authored-by: Philip Walton <philipwalton@users.noreply.github.com>

Co-authored-by: Philip Walton <philipwalton@users.noreply.github.com>
  • Loading branch information
tunetheweb and philipwalton committed Jan 12, 2023
1 parent 9c095c5 commit 0a87ab0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ The library supports all of the [Core Web Vitals](https://web.dev/vitals/#core-w

<a name="import-web-vitals-from-npm"><a>

The `web-vitals` library uses the `buffered` flag for [PerformanceObserver](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe), allowing it to access performance entries that occurred before the library was loaded.

This means you do not need to load this library early in order to get accurate performance data. In general, this library should be deferred until after other user-impacting code has loaded.

### From npm

You can install this library from npm by running:
Expand Down

0 comments on commit 0a87ab0

Please sign in to comment.