summaryrefslogtreecommitdiff
path: root/src/FetchImage.js
blob: e637bf1f1870633ce00051e8624b2b88877f3861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
 * Created by Victor Häggqvist on 1/12/16.
 */

export const FetchImage = (url) => {
    return new Promise((resolve, reject) => {
        fetch(url)
            .then(res => {
                var img = new Image();
                img.src = url;
                //console.log(img);
                resolve(img);
        });
    });
};