wtc-utility-preloader

1.0.5 • Public • Published

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.

Package Sidebar

Install

npm i wtc-utility-preloader

Weekly Downloads

23

Version

1.0.5

License

MIT

Last publish

Collaborators

  • wethecollective