Question 1 Response:
Repositories with StateFlow and state holders can look similar from a distance. They both expose flows of data. The difference is responsibility:
- Repository: Data-layer and domain synchronization (I/O, local DB, networking).
- StateHolder: UI-facing ephemeral or global states, minimal I/O, often short-lived data management.
Question 2 Response:
Having both an ApplicationStateStore for global state and separate, feature-specific holders does not necessarily create more chaos, instead, it provides flexibility.
When multiple features or screens need to observe and modify the same data (like user authentication status or global theme settings), centralizing it in an ApplicationStateStore avoids scattering that shared logic across the codebase.
On the other hand, if a feature requires only one small piece of unique, local state (such as onboarding steps), injecting a dedicated state holder directly into that feature is more efficient and keeps dependencies minimal.