image-promise
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -31,9 +31,12 @@ 'use strict'; | ||
load.unload = function (src) { | ||
return (loaded[src] || Promise.resolve({})).then(function (image) { | ||
// GC, http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/ | ||
image.src = EMPTY_IMAGE; | ||
delete loaded[src]; | ||
}); | ||
if (loaded[src]) { | ||
loaded[src].then(function (image) { | ||
// GC, http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/ | ||
image.src = EMPTY_IMAGE; | ||
delete loaded[src]; | ||
}); | ||
} | ||
return Promise.resolve(); | ||
}; | ||
module.exports = load; |
@@ -29,9 +29,12 @@ // let images = ['a.jpg','b.jpg']; | ||
load.unload = function (src) { | ||
return (loaded[src] || Promise.resolve({})).then(function (image) { | ||
// GC, http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/ | ||
image.src = EMPTY_IMAGE; | ||
delete loaded[src]; | ||
}); | ||
if (loaded[src]) { | ||
loaded[src].then(function (image) { | ||
// GC, http://www.fngtps.com/2010/mobile-safari-image-resource-limit-workaround/ | ||
image.src = EMPTY_IMAGE; | ||
delete loaded[src]; | ||
}); | ||
} | ||
return Promise.resolve(); | ||
}; | ||
export default load; |
{ | ||
"name": "image-promise", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Load an image and return a promise in the browser, in 0.4KB", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
5671
67