I have a screen that shows a list of elements built with Jetpack Compose.
From this screen, the user can navigate to a second screen to create new elements or edit existing ones.
How do I refresh the list of elements shown on the first screen when the second screen is closed or removed from the stack?
With the view system you could use onResume(), but what do you use in compose?
(I am using Room to store the elements, so I know I could return a Flowable
directly from the Dao that will listen to changes in the database, but that will mess up my existing architecture based on Use Cases that return a List<Element>
and not a Flowable<List<Element>>
.)