Skip to content

Instantly share code, notes, and snippets.

@tinybike
Created July 21, 2015 01:43
Show Gist options
  • Select an option

  • Save tinybike/2cb7451430d9ef82e7d3 to your computer and use it in GitHub Desktop.

Select an option

Save tinybike/2cb7451430d9ef82e7d3 to your computer and use it in GitHub Desktop.
JS dependency injection example
var ragefest = {
inquiry: "you mad, bro?"
};
var Syringe = function (drugs) {
return {
superHappy: function () {
console.log(drugs.inquiry);
}
}
};
new Syringe(ragefest).superHappy();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment