sewon
05/03/2020, 3:03 AMFeature Module A: create Koin for A
Feature Module B: create Koin for B
Common Feature Module: create Koin for Common. But Koin A, Koin B cannot get instances from Common Koin
Another way is each module define it’s own scope and define their own dependencies in there scope. By this way, they can use instances of shared library module and segregate their own dependencies. But to force feature module to use scope is not convenient. I should put scope before every get()
,inject()
call in modules.
Common Feature Module: create Koin
Feature Module A: create scopeA inside Common Koin
Feature Module B: create scopeB inside Common Koin
What I want is introducing parent - child Koin. In this concept, I can use KoinComponent
easily and can segregate each feature module.
Common Feature Module: create Koin for Common
Feature Module A: create Koin for A. set Koin for Common as parent Koin
Feature Module B: create Koin for B. set Koin for Common as parent Koin
Is this reasonable feature? Or is there any other better solution for this?kzotin
05/04/2020, 10:14 AMkoin module
, and whole graph is built combining into single koin instance in App
module.
Works without issues for us.. and the overhead is not that big, since instances are created lazilysewon
05/06/2020, 12:36 AMkzotin
05/06/2020, 7:02 PMItemsStorage: Storage<Item>
)sewon
05/07/2020, 12:49 AM