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.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

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)