-
-
Save uteke/d605ab74819e8461e0aa9359c1bab23d to your computer and use it in GitHub Desktop.
UserListViewModel with delegate
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 UserListViewModel( | |
private val actionProcessors: Collection<ActionProcessor<Action, Mutation, Event>>, | |
private val reducers: Collection<Reducer<Mutation, ViewState>>, | |
private val initialState: ViewState = ViewState(), | |
): ViewModel() { | |
private val model by model(actionProcessors, reducers, initialState) | |
internal val viewStateFlow: Flow<ViewState> get() = model.viewStateFlow | |
internal val eventFlow: Flow<Event> get() = model.eventFlow | |
fun process(action: Action) = model.process(action) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment