Most of this functionality is borrowed directly from how rememberSavedInstanceState works. Each screen now registers its own provider with its parent UiSavedStateRegistry. This means when compose-provided (topmost) registry saves, all of our child registries recursively save too. The rest of the implementation is identical, we still trigger save when a screen transitions offscreen, and restore that state when a screen comes back onscreen.
Fixes #28
Most of this functionality is borrowed directly from how
rememberSavedInstanceState
works. Each screen now registers its own provider with its parentUiSavedStateRegistry
. This means when compose-provided (topmost) registry saves, all of our child registries recursively save too. The rest of the implementation is identical, we still trigger save when a screen transitions offscreen, and restore that state when a screen comes back onscreen.Happy to make any changes/improvements!