Skip to content

Conversation

@g10
Copy link
Contributor

@g10 g10 commented Apr 11, 2014

The objects retrieved with getInstance() are themselves getting injected on creation (for the objects that are mapped on the injector with toType).

@g10
Copy link
Contributor Author

g10 commented Apr 11, 2014

2nd commit also adds this behaviour for toSingleton() + only initialize the singleton when it is requested with getInstance()

The late initialization is useful if an app has a config fase (where the mapping on the injector is done) before actual initialization of the app, the mappings can be done regardless of the presence of a dependent injection, as long it is present at the time (eg. app initialization fase) the (singleton) class is requested from the injector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant