Skip to content
This repository was archived by the owner on Feb 22, 2021. It is now read-only.

Commit c85de50

Browse files
authored
Update README.md
1 parent 0c267e4 commit c85de50

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
<br>
12
<div align="center" height="500">
2-
<img src="logo.png" width="350" height="220" align="center">
3+
<img src="logo.png" width="460" height="220" align="center">
34
</div>
45

5-
<br><br>
6+
<br><br><br>
67
### back-loader
78
> a easy and steady preload lib, you can use it to load all kinds of resources. use **back-loader** in your project,
89
> can quickly preload more pictures, styles(.css) or scripts, it will make your website more fluent.
@@ -17,17 +18,24 @@
1718
import { BackLoader } from 'back-loader'
1819

1920
const backHandler = new BackLoader({
20-
urls: string[],
21-
scripts: string[],
22-
styles: string[],
23-
images: string[],
21+
urls?: string[],
22+
scripts?: string[],
23+
styles?: string[],
24+
images?: string[],
2425
})
2526

2627
// at the right time:
2728
backHandler.start()
28-
backHandler.onload = (event: any) => {
29+
backHandler.onload = (event: loadEvent) => {
2930
console.log(event)
3031
}
32+
33+
type loadEvent = {
34+
source: string, // resource url, like: 'host.com/a.js'
35+
type: string, // resource type, like: 'script' / 'style' / 'image'
36+
success: boolean,
37+
insertScripts?: Function,
38+
}
3139
```
3240
3341
#### LICENSE

0 commit comments

Comments
 (0)