getOrProvide
Fetches an item for the given key.
If an entry for the key has not been previously registered, this function determines how to create a new one. Creation is subject to the allowedScopes predicate.
If the scope is allowed, a new entry is created using the provided putParams.
If the scope is not allowed, it delegates to onInvalidScope to create a fallback entry.
Parameters
The ServiceKey for the desired service.
A predicate to check if the current scope is valid for this provider.
The parameters needed to create a new ServiceEntry for key if one doesn't exist.
The parameters needed to retrieve the value from the entry.
Fetches an item for the given 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.
This is a convenience function equivalent to calling getOrProvide with classKey<T>().
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.