stupid-imageloader
v1.0.0
Published
A simple image loader
Downloads
3
Readme
Stupid Image Loader
A simple image loader
Usage
Load image:
var Imageloader = require('stupid-imageloader');
var imageloader = Imageloader();
imageloader.load('image.jpg') // returns a promise (stupid-deferred)
.success(function(image){
// Do something
})
.error(function(){
// Do something
});
Chain loading events:
imageloader.load('image.jpg') // returns a promise (stupid-deferred)
.then(function(){
// On success
return imageloader.load('new-image.jpg');
}, function(){
// On error
})
.then(function(){
return imageloader.load('another-new-image.jpg');
})
.then(function(){
// All 3 images is loaded after each other
});