haroldadmin / Vector

Kotlin Coroutines based MVI architecture library for Android
https://haroldadmin.github.io/Vector/
Apache License 2.0
193 stars 9 forks source link

Add support for automatic instantiation of a ViewModel constructor with initial state and coroutine context params #26

Closed haroldadmin closed 4 years ago

haroldadmin commented 4 years ago

Add support for automatic instantiation of a ViewModel with a constructor like this:

class SomeViewModel(
  initialState: State, 
  context: CoroutineContext
) : VectorViewModel(initialState, context)

These constructor parameters are accepted by the VectorViewModel class, so they should also be supported for automatic instantiation.