Is your feature request related to a problem? Please describe.
The Module class implements the "plus" operator which can be widely used in a codebase. Given a migration path to lazy APIs (meaning migrating from using module {} to lazyModule {}) there is no equivalent API for using "plus" operator.
Describe the solution you'd like
A "plus" operator for Lazy<Module> similar to what Module has.
Describe alternatives you've considered
Given a migration path there are no well-suited alternatives. Parity of operators should exist between Lazy<Module> and Module.
Target Koin projectcore
Note - Broken migration path
Considering the current implementation of the lazy modules, regardless of where the operator is implemented the migration path of a consumer from non-lazy to lazy APIs will require the addition of an import statement even though the "plus" operator of a Module does not (since the operator is implemented as a member of the class and not as an extension function). This is a side effect of not having a class for a "lazy module".
My suggestion as an overall improvement would be to create a LazyModule class that implements Lazy<Module> in order to:
Be compatible with the current APIs
Leverage delegation in order to implement Lazy logic
Having the option to keep parity between Module and LazyModule implementations
Is your feature request related to a problem? Please describe. The
Module
class implements the "plus" operator which can be widely used in a codebase. Given a migration path to lazy APIs (meaning migrating from usingmodule {}
tolazyModule {}
) there is no equivalent API for using "plus" operator.Describe the solution you'd like A "plus" operator for
Lazy<Module>
similar to whatModule
has.Describe alternatives you've considered Given a migration path there are no well-suited alternatives. Parity of operators should exist between
Lazy<Module>
andModule
.Target Koin project
core
Note - Broken migration path
Considering the current implementation of the lazy modules, regardless of where the operator is implemented the migration path of a consumer from non-lazy to lazy APIs will require the addition of an import statement even though the "plus" operator of a
Module
does not (since the operator is implemented as a member of the class and not as an extension function). This is a side effect of not having a class for a "lazy module".My suggestion as an overall improvement would be to create a
LazyModule
class that implementsLazy<Module>
in order to:Lazy
logicModule
andLazyModule
implementations