Created
September 8, 2018 17:55
-
-
Save letsar/7530f4cb03961b94a91bab49f3c87701 to your computer and use it in GitHub Desktop.
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
// Registers a new factory. | |
container.registerFactory((c) => Sith('Anakin', 'Skywalker')); | |
// Registers a new factory with a specified name. | |
container.registerFactory((c) => Sith('Anakin', 'Skywalker'), name: 'DartVader'); | |
// Registers a new factory, with a specified name, and under a supertype. | |
container.registerFactory<Character, Sith>((c) => Sith('Anakin', 'Skywalker'), name: 'DartVader'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment