image-promise
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -30,3 +30,3 @@ 'use strict'; | ||
function unload(src) { | ||
load.unload = function (src) { | ||
if (loaded[src]) { | ||
@@ -39,10 +39,4 @@ return loaded[src].then(function (image) { | ||
} | ||
} | ||
// rollup browserify compat | ||
// https://github.com/rollup/rollup/issues/496 | ||
if (typeof module !== 'undefined') { | ||
module.exports = load; | ||
} | ||
}; | ||
exports['default'] = load; | ||
exports.unload = unload; | ||
module.exports = load; |
@@ -28,3 +28,3 @@ // let images = ['a.jpg','b.jpg']; | ||
function unload(src) { | ||
load.unload = function (src) { | ||
if (loaded[src]) { | ||
@@ -37,9 +37,4 @@ return loaded[src].then(function (image) { | ||
} | ||
} | ||
// rollup browserify compat | ||
// https://github.com/rollup/rollup/issues/496 | ||
if (typeof module !== 'undefined') { | ||
module.exports = load; | ||
} | ||
}; | ||
export { unload };export default load; | ||
export default load; |
{ | ||
"name": "image-promise", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Load an image and return a promise in the browser, in 0.4KB", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -13,3 +13,3 @@ # image-promise | ||
```js | ||
import loadImage, {unload as unloadImage} from 'image-promise'; | ||
import loadImage from 'image-promise'; | ||
``` | ||
@@ -43,5 +43,2 @@ | ||
loadImage.unload('img.jpg'); | ||
// or, if you use ES2015: | ||
unloadImage('img.jpg') | ||
``` | ||
@@ -48,0 +45,0 @@ |
4993
65
51