preloadpics

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i preloadpics

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.27 kB

Total Files

6

Last publish

Collaborators

  • tyczynski