spierce707/22/2022, 8:55 PM
to watch the data changes from within the ViewModels, and then functions to pass events into the ViewModels, and to start loading etc. How should errors be handled when a network request fails? Should it be part of the observed Flow type, or is there a better way to handle this?
Francesc07/22/2022, 9:19 PM
, i.e., have the UI in an error state until the user does something, then it should be part of the state. If you want your error to be transient, for instance to show a snackbar, then you could have a
for events that the UI subscribes to and is used to trigger these transient events. If you use compose, then the recommendation is to have the error (or just events in general) as part of the state, then observe those in the UI using a
on the list of events and notifying the viewmodel when one has been consumed.