Hi, I have general question about architecting an ...
# orbit-mvi
k
Hi, I have general question about architecting an app with Orbit-MVI. Do you typically define one State subclass (an instance) or many for different parts of your app? I see both pros and cons of using one vs many States. One of the pros for single State is that there are parts that can be shared among many views. How to implement Shared State that will live in application scope and be accessible from smaller scopes?
m
It all depends on the scale I guess. I work in a huge codebase and we generally have a single state class per screen and no app-level state. We do leverage dagger (anvil) for some app-scope and sub-scoped dependencies and a persistence layer to pass larger amounts of data around.
🙌 1