You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In google samples certain events are propagated through SingleLiveEvent.
While this concept goes against MVI principle, it's needed in certain cases to greatly reduce boilerplate. For example, to show toast in current implementation I have to create a property inside my state, and inside View send an event back to ViewModel telling it that toast was shown.
Another similar solution can be used in every ViewModel to fire such one-off events.
Second example can be easily done through an additional subject inside MvRxStateStore and subscription inside withState
The text was updated successfully, but these errors were encountered:
@ATizik We use selectSubscribe for this. You will be delivered the initial value and any time it changes. We also have asyncSubscribe if it's an async prop to handle the unwrapped success or error values.
We use these to handle things like logging or showing toasts/snackbars.
If this isn't sufficient, can you reopen this with a specific use case?
In google samples certain events are propagated through SingleLiveEvent.
While this concept goes against MVI principle, it's needed in certain cases to greatly reduce boilerplate. For example, to show toast in current implementation I have to create a property inside my state, and inside
View
send an event back toViewModel
telling it that toast was shown.Another similar solution can be used in every
ViewModel
to fire such one-off events.Second example can be easily done through an additional subject inside
MvRxStateStore
and subscription insidewithState
The text was updated successfully, but these errors were encountered: