Skip to content

Commit 0a87ab0

Browse files
Add a note about when to load the library (#305)
* Add a note about when to load the library * Update README.md Co-authored-by: Philip Walton <[email protected]> Co-authored-by: Philip Walton <[email protected]>
1 parent 9c095c5 commit 0a87ab0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ The library supports all of the [Core Web Vitals](https://web.dev/vitals/#core-w
5151

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

54+
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.
55+
56+
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.
57+
5458
### From npm
5559

5660
You can install this library from npm by running:

0 commit comments

Comments
 (0)