dropbox / kaiken

User scoping library for Android applications.
Apache License 2.0
69 stars 11 forks source link

Add Authed Compose Deps and use effects to navigate activities #147

Closed viceversus closed 2 years ago

viceversus commented 2 years ago

Hi Mike,

This diff outlines how we would use a separate MutableSharedFlow for Effects which emit from the presenter back to the view. In the previous login example, we were keying off a view model to navigate, which was persisting on back. This led to unintended behavior when coming back from the next screen.

Effects here act as transient state. The presenter shouts and the view responds, but doesn't persist state. We can also use this for things like Snackbars/Toast.

This also fixes https://github.com/dropbox/kaiken/issues/133