is-image-loaded-async

1.0.3 • Public • Published

is-image-loaded-async

Return a Promise when one or more images, is loaded. <1KB, for the browser, no dependencies.

Install

At your choice

npm install --save is-image-loaded-async
yarn add is-image-loaded-async
<script src="https://unpkg.com/is-image-loaded-async"></script>

Usage

is-image-loaded-async(/* Node or NodeList*/)

Exemple

var isImageLoadedAsync = require("is-image-loaded-async")

// Multiple image
isImageLoadedAsync(document.querySelectorAll("img"))
  .then(v => console.log(v))
  .catch(e => console.log(e))
import isImageLoadedAsync from "is-image-loaded-async"

// Single image
isImageLoadedAsync(document.querySelector("img"))
  .then(v => console.log(v))
  .catch(e => console.log(e))
<script src="https://unpkg.com/is-image-loaded-async"></script>
<script type="text/javascript">
  window.isImageLoadedAsync(document.querySelector("img"))
</script>

Readme

Keywords

none

Package Sidebar

Install

npm i is-image-loaded-async

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

6.53 kB

Total Files

12

Last publish

Collaborators

  • ogromny