Hi!
I'm trying to use the ParameterFactory to create dynamic services.
At first I didn't read the documentation paragraph:
Finally, if you define a scope keep in mind that the first argument passed will be used to create the dependency and that dependency will be cached. Since the cached object will be returned from now on any arguments passed in later requests will be ignored until the factory or scope is reset.
My use case would be to have a cached version based on the parameter (the parameter is a Hashable), so when I request a service with the given parameter, it resolves the proper one based on the parameter and not the latest cached one. So it dynamically create services based on this parameter.
Is it something doable and is their a proper way to do it with Factory?
Thanks!
Hi!
I'm trying to use the
ParameterFactoryto create dynamic services.At first I didn't read the documentation paragraph:
My use case would be to have a cached version based on the parameter (the parameter is a
Hashable), so when I request a service with the given parameter, it resolves the proper one based on the parameter and not the latest cached one. So it dynamically create services based on this parameter.Is it something doable and is their a proper way to do it with Factory?
Thanks!