Implementing your view actions flow
MVFlow defines the view interface as follows:
interface View<State, Action> {
fun render(state: State)
fun actions(): Flow<Action>
}
Most developers should have a reasonable idea of how to implement render(state: State)
, but implementing
actions(): Flow<Action>
might not seem so obvious if this is the first time you are implementing your own
Flow.
We can suggest three different ways to implement this, each with different pros and cons.