source:
node_modules/d3-fetch/src/image.js
| Last change on this file was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 275 bytes | |
| Line | |
|---|---|
| 1 | export default function(input, init) { |
| 2 | return new Promise(function(resolve, reject) { |
| 3 | var image = new Image; |
| 4 | for (var key in init) image[key] = init[key]; |
| 5 | image.onerror = reject; |
| 6 | image.onload = function() { resolve(image); }; |
| 7 | image.src = input; |
| 8 | }); |
| 9 | } |
Note:
See TracBrowser
for help on using the repository browser.
