Skip to content

Instantly share code, notes, and snippets.

@letsar
Created September 8, 2018 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save letsar/0058f2605d72bf7587530f4ef6a36565 to your computer and use it in GitHub Desktop.
Save letsar/0058f2605d72bf7587530f4ef6a36565 to your computer and use it in GitHub Desktop.
// Registers a new instance.
container.registerInstance(Sith('Anakin', 'Skywalker'));
// Registers a new instance with a specified name.
container.registerInstance(Sith('Anakin', 'Skywalker'), name: 'DartVader');
// Registers a new instance, with a specified name, and under a supertype.
container.registerInstance<Character, Sith>(Sith('Anakin', 'Skywalker'), name: 'DartVader');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment