wtc-utility-preloader
v1.0.5
Published
Javascript utility helper preloader
Downloads
78
Maintainers
Readme
Preloader
Simple preloader class.
Requirements:
none
Options:
Preloader(<Object> options)
Default options
{
debug: false //set to true if you want console logs.
}
Usage:
//ES6 import
import Preloader from 'wtc-utility-preloader';
//Instanciate new Preloader
let preloader = new Preloader();
//ADD assets
preloader.add('imagename.jpg', 'image');
// OR use an ARRAY
preloader.add([
{file: 'imagename.jpg', type:'image'},
{file: 'imagename.jpg', type:'image'}
]);
preloader.load(callback);
TODO
- Improve to accept any type of file and use ajax.