Kazik
07/01/2025, 9:58 AMinterface RequestParser
@Single
class AImpl : RequestParser
@Single
class BImpl : RequestParser
@Single
class Repository(private val parsers: Set<RequestParser>)
Kibet Theophilus
07/01/2025, 11:45 AMKibet Theophilus
07/01/2025, 12:26 PMKazik
07/01/2025, 12:35 PM@IntoSet
and then just inject set of all implementations for specific interface type.Jonathan
07/01/2025, 12:40 PM@Named
https://insert-koin.io/docs/reference/koin-annotations/definitions/#injecting-a-list-of-dependencies---listtJonathan
07/01/2025, 12:41 PMlazy
by default but maybe if you create a custom module and add a function that returns a list of all your implementations.Kazik
07/01/2025, 12:43 PMList
instead of Set
🤔 At least now compiles. Not sure if it will work in runtime without Named
Jonathan
07/01/2025, 12:44 PM@Named
isn't required but I've not personally tested it. Good luck