Skip to content

Instantly share code, notes, and snippets.

@unscriptable
Created September 24, 2014 18:49
Show Gist options
  • Save unscriptable/d9b3a5dc227b95bbd0ad to your computer and use it in GitHub Desktop.
Save unscriptable/d9b3a5dc227b95bbd0ad to your computer and use it in GitHub Desktop.
script factory redux
/** @license MIT License (c) copyright 2014 original authors */
/** @author Brian Cavalier */
/** @author John Hann */
module.exports = scriptFactory;
function scriptFactory (scriptEval) {
return function (loader, load) {
return function () {
scriptEval(load.source);
};
};
}
/** @license MIT License (c) copyright 2014 original authors */
/** @author Brian Cavalier */
/** @author John Hann */
module.exports = scriptFactory;
function scriptFactory (scriptEval) {
return function (loader, load) {
return create(scriptEval, load.source);
};
}
function create (scriptEval, source) {
return function () { scriptEval(source); };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment