Coffeekraken.io 0.0.1

imageLoaded

Wait until the passed image is fully loaded

Name Type Description Status Default
img { HTMLImageElement } The image to check the loading state required
cb { Function } An optional callback to call optional null

Return { Promise } The promise that will be resolved

Example

    import imageLoaded from 'sugarcss/js/dom/imageLoaded'
imageLoaded(myCoolHTMLImageElement).then((img) => {
        // do something when the image is loaded
});

Author : Olivier Bossel olivier.bossel@gmail.com