I try to create a composite using it like this: ``...
# kodein
a
I try to create a composite using it like this:
Copy code
bind<Action>(tag = "ActionImpl2") with singleton { ActionImpl2() }
bind<Action>(tag = "ActionImpl2") with singleton { ActionImpl2() }
bind<Action>() with singleton {
	CompositeAction(
			allInstances<Action>()
	)
}
Problem here is that
allInstances<Action>()
is causing recursive error, probably because this is lazy loaded. Is it possible to invoke
allInstances<Action>()
in such a way that it will exclude it own bind and only loads the
Action
instances with a
tag
? Preferably I don't want to eager load.
s
Not easily possible at the moment, sorry 😞
Copy code
bind() from setBinding<Action>()
bind<Action>().inSet() with singleton { ActionImpl1() }
bind<Action>().inSet() with singleton { ActionImpl2() }
bind<Action>() with singleton {
    CompositeAction(
        instance<Set<Action>>()
    )
}
👍 1
a
Yes that works perfect, thanks!
s
👍