Open Alex009 opened 2 years ago
https://kotlinlang.slack.com/archives/CMC5LN42W/p1634901111003300?thread_ts=1634899812.002200&cid=CMC5LN42W
So for Koin, we have our own method too In common:
expect inline fun <reified T : BaseViewModel<*, *>> Module.viewModelDefinition( qualifier: Qualifier? = null, noinline definition: Definition<T> ): Pair<Module, InstanceFactory<T>>
While then for Android the implementation will call the Koin viewModel:
actual inline fun <reified T : BaseViewModel<*, *>> Module.viewModelDefinition( qualifier: Qualifier?, noinline definition: Definition<T>, ): Pair<Module, InstanceFactory<T>> = viewModel(qualifier = qualifier, definition = definition)
And for iOS will use a factory:
actual inline fun <reified T : BaseViewModel<*, *>> Module.viewModelDefinition( qualifier: Qualifier?, noinline definition: Definition<T>, ): Pair<Module, InstanceFactory<T>> = factory(qualifier = qualifier, definition = definition)
.
any updates?
any updates? +1
No updated on that? I think it would be a really useful implementation.
https://kotlinlang.slack.com/archives/CMC5LN42W/p1634901111003300?thread_ts=1634899812.002200&cid=CMC5LN42W
So for Koin, we have our own method too In common:
While then for Android the implementation will call the Koin viewModel:
And for iOS will use a factory: