Matthew Dolan
Jan 17, 2021

--

It’s worth checking out the library https://github.com/orbit-mvi/orbit-mvi. I am a co-author on the project.

Internally the library works in a similar way to how this article suggests although we suggest just calling through to methods in the ViewModel rather than creating an event object which simplifies things somewhat. We have a DSL around this which keeps the code relatively tidy.

Something to be cautious of though is threading — at the moment the code presented in the article can modify the state through setState concurrently which could lead to corrupting the state.

In terms of when to use MVI, personally I believe it can work well for both simple and complex apps. To me one of the biggest attractions of MVI is it can make testing a whole lot simpler.

--

--

Matthew Dolan
Matthew Dolan

Written by Matthew Dolan

Matt Dolan has been eating doughnuts and developing with Android since the dark days of v1.6.

Responses (2)