MVI - Desired State Pattern
In this blog, I want to briefly look at a pattern for dealing with progressive asynchronous state changes . For the example, we will have an engine and software to mange the startup and shutdown. We'll be using this with MVI Android Compose. The handling of the engine itself is very basic. We need to know if it is stopped or running . But, we also need to know if it between those states. We need starting and stopping states as well. This is mainly aimed at intermediate to advanced programmers, but the MVI covered and thinking behind everything should also be of interest to anyone. Why? I had no intention of writing this blog post originally, but I came across this while working on another post. I was interested in the Reducer pattern; a way of handling all UI state updates in one function. For that post, I originally created a UI example for a car's audio / electronic / engine; however, the engine part of that didn't really work very well and I came across the Desired St...