Skip to content

Instantly share code, notes, and snippets.

@natemcmaster natemcmaster/CrappyBank.js

Last active Aug 29, 2015
Embed
What would you like to do?
Injector syntax
/// Config.js
Injector.register('GameBoard',GameBoard);
Injector.register('Bank',CrappyBank);
function CrappyBank(data){
}
function GameBoard(data,$Bank,$Traker){
this.bank = $Bank(data);
this.players = $Traker(data);
}
Injector.create = function(name){
dep = registered function for name
for all dollar sign args of dep.constructor:
arg = new Injector.create(arg)
}
function MockBank(data){
}
function TrackerImpl(data,name,$Player){
this.player= $Player(name);
this.data= data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.