getOrProvide
Fetches the singleton instance for the given class key.
If an instance has not been previously registered, it creates and stores a new one using the provider lambda. Creation is subject to the allowedScopes predicate; if the current scope is not allowed, this delegates to onInvalidScope.
The multi-thread behavior depends on threadSafetyMode.
Parameters
The class of the service to retrieve.
A predicate to check if the current scope is valid for this provider.
The thread safety mode for the lazy initialization.
A lambda that creates the service instance if one doesn't exist.
Fetches the singleton instance for the reified type T.
If an instance has not been previously registered, it creates and stores a new one using the provider lambda. Creation is subject to the allowedScopes predicate; if the current scope is not allowed, this delegates to onInvalidScope.
The multi-thread behavior depends on threadSafetyMode.
This is a convenience function equivalent to calling getOrProvide with T::class.
Parameters
The service type to retrieve.
A predicate to check if the current scope is valid for this provider.
The thread safety mode for the lazy initialization.
A lambda that creates the service instance if one doesn't exist.