pic-loader

0.0.1 • Public • Published

Pic-loader

This is a tiny module to preload images in the browser. Nobody likes flashing images with constant jumping DOM elements, right? You just pass links, in any convenient way – list of urls, single url, or urls through commas, and you will get a Promise as a return value, which will be resolved when all images will be downloaded.

Example

import { preload } from 'pic-loader';
 
const links = ['http://example.com/first_image.jpg', 'http://example.com/second_image.jpg'];
 
preload(links).then(() => {
  // show needed data
});

Package Sidebar

Install

npm i pic-loader

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • bloomca