Skip to content

Commit 7ba57a6

Browse files
committed
docs(README): changes for new boolean priority
1 parent d3c3806 commit 7ba57a6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ The above options are best for multi-page sites. Single-page apps have a few opt
7979
* `urls`: Static array of URLs to prefetch (instead of observing `document` or a DOM element links in the viewport)
8080
* `timeout`: Integer for the `requestIdleCallback` timeout. A time in milliseconds by which the browser must execute prefetching. Defaults to 2 seconds.
8181
* `timeoutFn`: Function for specifying a timeout. Defaults to `requestIdleCallback`. Can also be swapped out for a custom function like [networkIdleCallback](https://github.com/pastelsky/network-idle-callback) (see demos)
82-
* `priority`: String specifying preferred priority for fetches. Defaults to `low`. `high` will attempt to use the `fetch()` API where supported (rather than rel=prefetch)
82+
* `priority`: Boolean specifying preferred priority for fetches. Defaults to `false`. `true` will attempt to use the `fetch()` API where supported (rather than rel=prefetch)
8383

8484
TODO:
85-
* Explore detecting file-extension of resources and using [rel=preload](https://w3c.github.io/preload/) for `high` priority fetches
85+
* Explore detecting file-extension of resources and using [rel=preload](https://w3c.github.io/preload/) for high priority fetches
8686
* Explore using [Priority Hints](https://github.com/WICG/priority-hints) for importance hinting
8787

8888
## Polyfills
@@ -133,11 +133,10 @@ quicklink({
133133

134134
**Set the request priority for prefetches**
135135

136-
Defaults to low-priority (`rel=prefetch` or XHR). For high-priority,
137-
attempts to use `fetch()` or falls back to XHR.
136+
Defaults to low-priority (`rel=prefetch` or XHR). For high-priority (`priority: true`), attempts to use `fetch()` or falls back to XHR.
138137

139138
```js
140-
quicklink({ priority: 'high' });
139+
quicklink({ priority: true });
141140
```
142141

143142
## Browser support
@@ -147,7 +146,7 @@ The prefetching provided by `quicklink` can be viewed as a [progressive enhancem
147146
* Without polyfills: Chrome, Firefox, Edge, Opera, Android Browser, Samsung Internet.
148147
* With [Intersection Observer polyfill](https://github.com/w3c/IntersectionObserver/tree/master/polyfill) ~6KB gzipped/minified: Safari, IE9+
149148

150-
Certain features have layered support. If opting for `{priority:'high'}` and `fetch()` isn't available, XHR will be used instead.
149+
Certain features have layered support. If opting for `{priority: true}` and `fetch()` isn't available, XHR will be used instead.
151150

152151
## Using the prefetcher directly
153152

0 commit comments

Comments
 (0)