Maintaining and controlling state in an app is something that quickly becomes complicated as soon as our app is larger than a Todo app, especially if we have multiple views, models, and dependencies between them. The situation is complicated by multiple types of states, such as cached data, server responses, and data that only lives locally when you work with the app. Changing the state is made more complicated because multiple actors, synchronous, and asynchronous code can change the state. The end result with a growing app is, sooner or later, a non-deterministic system. The problem with such a system is that you lose predictability, which in turn means you may have bugs that are hard to produce, and it makes the app and its data hard to reason with. We crave order and predictability, but we get neither.
To try to address the problem, we covered the Flux pattern in a previous...