Skip to content

Commit 3064415

Browse files
committed
Update documentation
1 parent bfc06fb commit 3064415

3 files changed

Lines changed: 5 additions & 26 deletions

File tree

README.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ A Compose-multiplatform navigation library that leverage [Decompose](https://git
2323
A detailed breakdown available in this [Medium article](https://proandroiddev.com/diy-compose-multiplatform-navigation-with-decompose-94ac8126e6b5)
2424

2525
## Features
26-
- 🚏 A `Router` that manages a FILO stack for your screen configurations
26+
- 🚏 A `Router` that manages a stack, pages or slot for your screen configurations
2727
- 📦 `rememberOnRoute()` lets you retain your view model across configuration changes and gets cleared when the user leaves the screen
28-
- ☠️ A `SavedStateHandle` to restore state gracefully after the process death. (for Android)
2928
- 🚉 Multiplatform! Supports Android, WearOS, Desktop, iOS and Web
3029

3130
## At a glance
@@ -55,25 +54,6 @@ fun ListDetailScreen() {
5554
}
5655
}
5756
}
58-
59-
@Composable
60-
fun DetailsScreen(detail: String) {
61-
// 📦 Scope an instance (a view model, a state-holder or whatever) to a route with [rememberOnRoute]
62-
// This makes your instances survive configuration changes (on android) 🔁
63-
// And holds-on the instance as long as it is in the backstack 🔗
64-
// Pass in key if you want to reissue a new instance when key changes 🔑 (optional)
65-
val instance: DetailInstance = rememberOnRoute(key = detail) { savedState -> DetailInstance(savedState, detail) }
66-
67-
val state: DetailState by instance.states.collectAsState()
68-
Text(text = state.detail)
69-
}
70-
71-
// If you want your state to survive process death ☠️ derive your initial state from [SavedStateHandle]
72-
class DetailInstance(savedState: SavedStateHandle, detail: String) : InstanceKeeper.Instance {
73-
private val initialState: DetailState = savedState.get() ?: DetailState(detail)
74-
private val stateFlow = MutableStateFlow(initialState)
75-
val states: StateFlow<DetailState> = stateFlow
76-
}
7757
```
7858

7959
### Installation and Usage

docs/topics/overview.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
A Compose-multiplatform navigation library that leverage [Decompose](https://github.com/arkivanov/Decompose) to create an API inspired by [Conductor](https://github.com/bluelinelabs/Conductor)
1717

1818
## Features
19-
- 🚏 A `Router` that manages a FILO stack for your screen configurations
20-
- 📦 `rememberOnRoute()` lets you retain your view model across configuration changes and gets cleared when the user leaves the screen
21-
- ☠️ A `SavedStateHandle` to restore state gracefully after the process death. (for Android)
19+
- 🚏 A `Router` that manages a stack, pages or slot for your screen configurations
20+
- 📦 `rememberOnRoute()` lets you retain your state holders across configuration changes and gets cleared when the user leaves the screen
2221
- 🚉 Multiplatform! Supports Android, WearOS, Desktop, iOS and Web
2322

2423
## At a glance

docs/topics/using-decompose-router.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
Decompose router supports the following navigation models, that is driven by a [model](#model-driven-navigation)
44

55
1. [Stack navigation](using-stack-navigation.md)
6-
2. Page navigation 🚧
7-
3. Slot navigation 🚧
6+
2. [Page navigation](using-pages-navigation.md)
7+
3. [Slot navigation](using-slot-navigation.md)
88

99
These are the same ones supported by [Decompose](https://github.com/arkivanov/Decompose)
1010

0 commit comments

Comments
 (0)