2.0.1 • Published 6 years ago

web-assets-manager v2.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

web-assets-manager

code style: prettier Dependency Status DevDependency Status Travis Build Status NPM Downloads

Manager for web assets.

Install

$ npm install web-assets-manager

Usage

// wam is a singletone
import wam from 'web-assets-manager';

const assets = {
  logo: 'https://cdn.example.com/logo.png',
  bg: 'https://cdn.example.com/bg.jpg',
  // ...
};

// setup assets
wam.setup(assets);

// preload assets
wam.preload(
  function onProgress(currentProgress) {
    console.log(currentProgress);
  },
  function onComplete() {
    console.log('complete');
  }
);

// get assets
wam.get('logo'); // 'https://cdn.example.com/logo.png'
wam.get('bg'); // 'https://cdn.example.com/bg.jpg'

Todo

  • documents about API
  • strict type checking
2.0.1

6 years ago

2.0.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago