waitasecond
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -43,6 +43,19 @@ "use strict"; | ||
case 0: return [4 /*yield*/, Promise.all(Array.from(element.querySelectorAll('img')).map(function (imgElement) { | ||
return new Promise(function (resolve) { | ||
return new Promise(function (resolve, reject) { | ||
if (imgElement.complete) { | ||
if (imgElement.naturalHeight === 0) { | ||
reject(imgElement); | ||
} | ||
else { | ||
resolve(); | ||
} | ||
return; | ||
} | ||
; | ||
imgElement.addEventListener('load', function () { | ||
resolve(); | ||
}); | ||
imgElement.addEventListener('error', function () { | ||
reject(imgElement); | ||
}); | ||
}); | ||
@@ -49,0 +62,0 @@ }))]; |
@@ -7,2 +7,2 @@ import { forAllImagesInElement } from './functions/forAllImagesInElement'; | ||
import { forValueDefined } from './functions/forValueDefined'; | ||
export { forAllImagesInElement, forAnimationFrame, forImmediate, forTime, forValueDefined, forDocumentLoad }; | ||
export { forAllImagesInElement, forAnimationFrame, forImmediate, forTime, forValueDefined, forDocumentLoad, }; |
{ | ||
"name": "waitasecond", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Simple tool library for the waiting using Promises.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14437
214