Hi all, I have a config bean and a service bean, t...
# koin
s
Hi all, I have a config bean and a service bean, the service bean has two impl, I need to choose one service impl to register by the condition(using config to calculate the condition). How can I do? or maybe I can registry them all, and inject by condition, I don’t know how to do in koin also.
maybe it likes the
@ConditionalOnProperty
in Spring.
s
register both, inject 1 via named argument?
a
you can consider a conidition at several place: • in your definition function • by injecting parameter for your condition
s
thx, I register both, and inject 1 via name. same as @Scott Kruse