Post

Navigation state is also UI state. What screen to display at any time is literally UI state. Don’t think of it differently.

0 reposts0 likes

No, quite the opposite in my opinion. The UI layer is just one consumer of the navigation state. If I run my app headless, then there's no UI layer.

That’s only a consequence of how you are implementing it. The only difference between updating a state to show / hide a small component within the same screen, and doing the same but to show / hide a full screen to the user, is the size of the component.

I think it’s better to define State as the strict outcome of business logic, while the representation of that state belongs entirely to the UI layer. eg if VM emits error: Throwable?, that is business outcome. UI's job is to interpret that state and decide the mechanism; a Dialog/Snackbar,new screen