Skip to content

Commit d67a31a

Browse files
committed
docs(README): add link to gatsby guess plugin + prefetch notes
1 parent 2c04988 commit d67a31a

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,24 @@ The prefetching provided by `quicklink` can be viewed as a [progressive enhancem
149149

150150
Certain features have layered support. If opting for `{priority:'high'}` and `fetch()` isn't available, XHR will be used instead.
151151

152+
## Using the prefetcher directly
153+
154+
`quicklink` includes a prefetcher that can be individually imported for use in other projects. After installing `quicklink` as a dependency, you can use it as follows:
155+
156+
```html
157+
<script type="module">
158+
import prefetch from '../src/prefetch.mjs';
159+
160+
const urls = ['1.html', '2.html'];
161+
const promises = urls.map(url => prefetch(url));
162+
Promise.all(promises);
163+
</script>
164+
```
165+
152166
## Related projects
153167

154168
* Using [Gatsby](https://gatsbyjs.org)? You already get most of this for free baked in. It uses `Intersection Observer` to prefetch all of the links that are in view and provided heavy inspiration for this project.
155-
* Want a more data-driven approach? See [Guess.js](https://guessjs.com). It uses analytics and machine-learning to prefetch resources based on how users navigate your site. It also has plugins for Webpack and Gatsby.
169+
* Want a more data-driven approach? See [Guess.js](https://guessjs.com). It uses analytics and machine-learning to prefetch resources based on how users navigate your site. It also has plugins for [Webpack](https://www.npmjs.com/package/guess-webpack) and [Gatsby](https://www.gatsbyjs.org/docs/optimize-prefetching-with-guessjs/).
156170

157171
## License
158172

0 commit comments

Comments
 (0)