Created
September 8, 2018 17:57
-
-
Save letsar/d39f9053ff183247103b016aea608cb6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 singleton. | |
container.registerSingleton((c) => Sith('Anakin', 'Skywalker')); | |
// Registers a new singleton with a specified name. | |
container.registerSingleton((c) => Sith('Anakin', 'Skywalker'), name: 'DartVader'); | |
// Registers a new singleton, with a specified name, and under a supertype. | |
container.registerSingleton<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