Skip to content

Commit 3609ac9

Browse files
committed
docs(README): add notes on unpkg and initializing
1 parent cada9d4 commit 3609ac9

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ For use with [node](http://nodejs.org) and [npm](https://npmjs.com):
1818
npm install --save quicklink
1919
```
2020

21+
You can also grab `quicklink` from [unpkg.com/quicklink](https://unpkg.com/quicklink).
22+
2123
## Usage
2224

2325
Once initialized, `quicklink` will automatically prefetch URLs for links that are in-viewport during idle time.
@@ -27,12 +29,22 @@ Quickstart:
2729
```html
2830
<!-- Include quicklink from dist -->
2931
<script src="dist/quicklink.js"></script>
30-
<!-- Initialize (you can do this to whenever you want) -->
32+
<!-- Initialize (you can do this whenever you want) -->
3133
<script>
3234
quicklink();
3335
</script>
3436
```
3537

38+
For example, you can initialize after the `load` event fires:
39+
40+
```html
41+
<script>
42+
window.addEventListener('load', () =>{
43+
quicklink();
44+
});
45+
</script>
46+
```
47+
3648
ES Module import:
3749

3850
```js

0 commit comments

Comments
 (0)