Skip to content

Commit

Permalink
Fixed stack docs
Browse files Browse the repository at this point in the history
  • Loading branch information
arkivanov committed Nov 25, 2023
1 parent a92f068 commit 4a90186
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/navigation/stack/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class DefaultItemDetailsComponent(
val childStack: Value<ChildStack<*, Child>>

sealed class Child {
class ListChild(val component: ItemList) : Child()
class DetailsChild(val component: ItemDetails) : Child()
class ListChild(val component: ItemListComponent) : Child()
class DetailsChild(val component: ItemDetailsComponent) : Child()
}
}

Expand Down Expand Up @@ -140,8 +140,8 @@ class DefaultItemDetailsComponent(
val childStack: Value<ChildStack<*, Child>>

sealed class Child {
class ListChild(val component: ItemList) : Child()
class DetailsChild(val component: ItemDetails) : Child()
class ListChild(val component: ItemListComponent) : Child()
class DetailsChild(val component: ItemDetailsComponent) : Child()
}
}

Expand Down Expand Up @@ -268,9 +268,9 @@ class DefaultRootComponent(
componentContext = componentContext,
itemId = config.itemId,
onDeleted = { itemId ->
navigation.pop { // Pop ItemDetails component
navigation.pop { // Pop ItemDetailsComponent
// Deliver the result to ItemList component
(stack.value.active.instance as? ItemList)?.onItemDeleted(id = itemId)
(stack.active.instance as? ListChild)?.component?.onItemDeleted(id = itemId)
}
}
)
Expand Down Expand Up @@ -349,7 +349,7 @@ class DefaultRootComponent(
componentContext = componentContext,
itemId = config.itemId,
onItemDeleted = { id ->
navigation.pop { // Pop ItemDetails component
navigation.pop { // Pop ItemDetailsComponent
// Deliver the result to ItemList component
listInput.onNext(ItemList.Input.ItemDeleted(id = id))
}
Expand Down

0 comments on commit 4a90186

Please sign in to comment.