@twaves/imagepreload
v1.0.1
Published
image preload
Downloads
5
Readme
install
sudo npm install @twaves/imagepreload
Use
import ImagePreload from '@twaves/imagepreload';
ImagePreload({
data: [
{
url: 'resource url include http or https',
type: 'bg' // background tag
},
{
url: 'resource url include http or https',
type: 'img' // img tag
}
],
// Download resources with a few milliseconds delay, default: 0
delay: 1000,
// The minimum number of milliseconds to download resources
minTime: 1000,
// Download progress
onProgress: (percent) => {
console.log('percent', percent); // [0-100]
},
// Download completed
onComplete: () => {
console.log('complete'); // complete
}
})