1.0.0 • Published 5 years ago

preloadpics v1.0.0

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

preloadpics npm version

Lightweight library for preloading images with callback.

Usage

preloadpics(
  // array with urls
  sources,
);

Example

import preloadpics from 'preloadpics';

preloadpics([
  'https://images.unsplash.com/photo-1569099377939-569bbac3c4df?ixlib=rb-1.2.1',
  'https://images.unsplash.com/photo-1569133237946-091ca2397418?ixlib=rb-1.2.1',
  'https://images.unsplash.com/photo-1569099377939-569bbac3c4df?ixlib=rb-1.2.1',
]).then(results => console.log('finished')); // results => array with `load` and `error` events of the `Image` object.

License

MIT © Przemysław Tyczyński