0.2.0 • Published 5 years ago

img-preloader v0.2.0

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

Img-Preloader

Simple image preloader that supports promises, callbacks, ES5, ES6, your emotional well-being... You name it!

Install

npm i -S img-preloader

Include

With Import:

import ImgPreloader from 'img-preloader'

Or using script tag:

<script src="path/to/img-preloader/dist/img-preloader.min.js"></script>

Usage

// Promise
ImgPreloader('/myimage.jpg')
    .then(function(img) {
        // handle success
    })
    .catch(function(err) {
        // handle error
    })
    .finally(function() {
        // do something always
    })

// Or Callback
ImgPreloader('/myimage.jpg', function(img, err) {
    // do something
})
0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago