oldergod / android-architecture

MVI architecture Implementation of the ToDo app.
Apache License 2.0
669 stars 70 forks source link

Don't emit duplicate consecutive MviViewStates #31

Closed vlazzle closed 6 years ago

vlazzle commented 6 years ago

When a reducer just emits previousState, there's no reason to call render. In fact, redrawing the UI in cases like this can cause jank (e.g. messing up snackbar animations by showing the same snackbar twice in rapid succession).

I'd fix this with a distinctUntilChanged right after scan in compose