This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val applicationModule = module { | |
... | |
} | |
val activityModule = module { | |
declareScope(scopeMainActivity) | |
... | |
} | |
val interactorModule = module { | |
factory { SomeInteractor(get()) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class App : Application() { | |
override fun onCreate() { | |
super.onCreate() | |
startKoin { | |
androidContext(this@App) | |
modules( | |
listOf( | |
applicationModule, | |
interactorModule, | |
activityModule, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val scopeMainActivity= ScopeSet(named<MainActivity>()).apply { | |
viewModel { (activity: Actitivty) -> | |
val data = activity.intent.getStringExtra("DATA") | |
MainViewModel(MainViewState(), data) | |
} | |
} | |
class MainActivity : BaseActivity<MainViewModel, MainViewState, ActivityMainBinding>(), MainView { | |
override var viewModelFactory: MainViewModelFactory = MainViewModelFactory(Provider { | |
currentScope.viewModel( |
OlderNewer