Ubiquitous Guacamole

Perhaps the best image preloader on Earth.
Demo

Installation
Just run
npm i @nd0ut/ubiquitous-guacamole --save
or
yarn add @nd0ut/ubiquitous-guacamole --save
Usage
import loadImages from '@nd0ut/ubiquitous-guacamole';
loadImages(['urls', 'or', 'HTMLImageElements'])
.then(images => {
const [img, state] = images[0];
console.log(state);
state === loadImages.State.COMPLETELY_AVAILABLE
}
.catch(images => {
const [img, state] = images[0];
console.log(state);
state === loadImages.State.COMPLETELY_AVAILABLE || state === loadImages.State.BROKEN
});
API
loadImages (default export)
Parameters
Returns Promise<Array<[HTMLImageElement, loadImages.State]>>
loadImages.State
COMPLETELY_AVAILABLE
string('completely_available') Image loading success (w3c)BROKEN
string('broken') Image loading failed (w3c)