1.0.4 • Published 4 years ago

easy-img-preloader v1.0.4

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

EasyImgPreloader

Image preloader, suitable for the need to load image resources in advance of the scenario.

tips: Image loading failure, we also identified as the loaded.

Install

npm i easy-img-preloader
// or
yarn add easy-img-preloader

Basic Usage

easyImgPreloader(images,callback,timeout);

Params

nametypedefaultRequiredDesc
imagesArray[]trueImage list
callback(progress) => {}--The loaded complete
timeoutInt5000-The load timeout for each image

Examples

import easyImgPreloader from 'easy-img-preloader';

easyImgPreloader([
    require('./p1.png'), // preload local image
    'http://www.test.com/p2.png' // preload remote image
],(progress)=>{
    progress === 1 && console.log('All images have been loaded');
},3000);
1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0-alpah.2

4 years ago

1.0.0-alpah.1

4 years ago

1.0.0

4 years ago