put
Registers a lazy singleton provider using a LazyClassKey for the reified type T.
The provider will be invoked only the first time a value is requested for the type T. The created instance is then stored and reused for all subsequent requests.
Parameters
The service type to register.
The LazyThreadSafetyMode for the initialization.
A lambda that creates the service instance.
Registers an eager singleton instance using a SingletonClassKey for the reified type T.
The provided value is stored directly and will be returned for all subsequent requests for the type T.
Parameters
The service type to register.
The service instance to store.
Registers a lazy singleton provider for the given key.
The provider lambda will be invoked only the first time a value is requested for this key. The created instance will be stored and reused for all subsequent requests.
By default, it is an error to register the same key more than once.
Parameters
The LazyKey to associate with the provider.
The LazyThreadSafetyMode for the initialization.
A lambda that creates the service instance.