Last active
August 29, 2015 13:57
-
-
Save natemcmaster/9554355 to your computer and use it in GitHub Desktop.
Injector syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Config.js | |
Injector.register('GameBoard',GameBoard); | |
Injector.register('Bank',CrappyBank); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CrappyBank(data){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function GameBoard(data,$Bank,$Traker){ | |
this.bank = $Bank(data); | |
this.players = $Traker(data); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Injector.create = function(name){ | |
dep = registered function for name | |
for all dollar sign args of dep.constructor: | |
arg = new Injector.create(arg) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function MockBank(data){ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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