image-halt
Preload images with an option to cancel the transfer if needed without stoping the window loading.
Installation
NPM
npm i image-halt --save
Usage
var ImageHalt = ; var paths = 'a.jpg' 'b.png' 'c.gif';var images = ; { if err // handle the error return; documentbody;} // register paths; // ...// later on we cancel themimages;
Basic Methods
name | description | return |
---|---|---|
load | Creates a new in-memory image object and start listening for it to load. | self |
abort | Cancel the image transfer. | self |
Other Methods
name | description | return |
---|---|---|
isLoaded | Returns whether or not the image has already been loaded. | Boolean |
License
MIT © Noel Delgado