|
Last change
on this file since ba17441 was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
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.