Gabriel Feo
07/24/2020, 9:51 PMdata class State(action: Action, list: ListState)
fun getState(events: Flow<ViewEvent>): Flow<State> {
return combine(
getActionState(events).onStart { emit(Action.None) },
getListState().onStart { emit(ListState.Loading) }
) { action, lovedOnesState ->
State(action, lovedOnesState)
}
}
If a ListState change causes a new State to be emitted, the next ViewEvents need to be reduced against this new State, and vice-versa, that's why I combinedekans
07/25/2020, 6:17 PM