whenImageLoaded

Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.when

Wait until the passed image is fully loaded

Params

  1. $img*-HTMLImageElement

    The image to check the loading state

Return

  1. -SPromise

    The promise that will be resolved when all the images are correctly loaded

Example

import { whenImageLoaded } from '@blackbyte/sugar/dom'
whenImageLoaded($myCoolHTMLImageElement).then(($img) => {
  // do something when the image is loaded
});

Todo

  • testsnormal