Skip to content

Instantly share code, notes, and snippets.

@geNAZt
Created May 5, 2013 11:06
Show Gist options
  • Save geNAZt/5520510 to your computer and use it in GitHub Desktop.
Save geNAZt/5520510 to your computer and use it in GitHub Desktop.
this.inject = function(fn) {
return function() {
var inject = annotate(fn);
var callArgs = [];
var args = Array.prototype.slice.call(arguments, 0);
inject.forEach(function(arg) {
if (arg.slice(0,1) === "$") {
callArgs.push(use[arg]);
} else {
callArgs.push(args.shift());
}
});
return fn.apply(this, callArgs);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment