Assigned
Status Update
Comments
ch...@google.com <ch...@google.com>
ni...@google.com <ni...@google.com>
se...@gmail.com <se...@gmail.com> #2
Hello, can you please attach a sample that reproduces your error?
Description
Before you start, please check existing proposals athttps://issuetracker.google.com/issues?q=hotlistid:3426315%20status:open
Description: A common pattern that developers currently follow in a Single Activity + Multi fragment world is that the fragment VM exposes a single state that is consumed by the fragment AND a single stream of events that is emitted from the VM to the fragment.
In a pure compose app, it seems as though emitting "events" from the VM to be handled by a composable screen isn't really best practice. Need some documentation to point to for my team on how to handle this.
Use Case: Example: I have @Composable ScreenA and @Composable ScreenB. On ScreenA there is a button, and that button click calls screenAVm.buttonClick(). buttonClick does some logic (validates the user, some other properties, maybe even makes a network call). Depending on that logic, it takes 1 of 3 routes. 1. The user should be navigated to ScreenB or 2. Show a toast or 3. Show a snackbar.