Skip to content

Instantly share code, notes, and snippets.

View AntoniusGolly's full-sized avatar

Antonius Golly AntoniusGolly

  • Berlin, Germany
View GitHub Profile
@aganglada
aganglada / script-cache.js
Created February 24, 2017 11:00
Script Cache Promise based
let counter = 0;
let scriptMap = new Map();
export const ScriptCache = (function(global) {
return function ScriptCache (scripts) {
const Cache = {};
Cache._onLoad = function(key) {
return (cb) => {
let stored = scriptMap.get(key);