imgz
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Imgz npm npm Build Status JavaScript Style Guide

Tiny image sources loader. 🖼

Install

Yarn

yarn add imgz

NPM

npm install imgz --save

The UMD and style builds are also available on unpkg.

<link rel="stylesheet" href="https://unpkg.com/imgz/dist/imgz.min.css">

You can use the component via window.imgz

Usage

import { Loader } from 'imgz'
 
const images = [
  'https://i.imgur.com/G5MR088.png',
  'http://server/not-found-image.png',
  'https://i.imgur.com/G5MR088.png'
]
 
Loader (images, (image, index, event) => console.log('Image loaded:', image))

API

Loader (
  // Sources
  sourcestring | string[],
  // Source loaded
  (image: HTMLImageElement | null, index: number, event: LoadEvent | ErrorEvent) => void,
  // Sources completed (optional)
  (length: number) => void
)

See index.d.ts for more details.

Contributions

Pull requests or issues are very appreciated.

License

MIT license

© 2018 José Luis Quintana

Readme

Keywords

Package Sidebar

Install

npm i imgz

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

6.82 kB

Total Files

6

Last publish

Collaborators

  • joseluisq