summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/FetchImage.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/FetchImage.js b/src/FetchImage.js
new file mode 100644
index 0000000..e637bf1
--- /dev/null
+++ b/src/FetchImage.js
@@ -0,0 +1,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);
+ });
+ });
+};