const hash = {};
const cache = [];

const add = url => {
    if (!hash[url]) {
        hash[url] = new Image();
        hash[url].src = url;

        cache.push(hash[url]);
    }
    return hash[url];
};

const get = url => {
    return add(url);
};

const stuff = (urls) => {
    if (urls.length > 0) {
        urls.map(add);
    }
};

const ImageCache = {
    add,
    stuff,
    get,
    hash,
    cache,
};

export default ImageCache;

@@ -105,16 +105,106 @@
 mage();%0A
+        hash%5Burl%5D.crossorigin = 'anonymous';%0A        hash%5Burl%5D.crossOrigin = 'anonymous';%0A
         

Add crossorigin attribute to images so they can be laoded into canvases