commonMain.com.arkivanov.decompose.router.pages.PagesNavigation.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of decompose Show documentation
Show all versions of decompose Show documentation
Kotlin Multiplatform lifecycle-aware business logic components
package com.arkivanov.decompose.router.pages
import com.arkivanov.decompose.router.children.NavigationSource
import com.arkivanov.decompose.router.pages.PagesNavigation.Event
/**
* Represents [PagesNavigator] and [PagesNavigationSource] at the same time.
*/
interface PagesNavigation : PagesNavigator, NavigationSource> {
class Event(
val transformer: (Pages) -> Pages,
val onComplete: (newPages: Pages, oldPages: Pages) -> Unit = { _, _ -> },
)
}
/**
* Returns a default implementation of [PagesNavigation].
* Broadcasts navigation events to all subscribed observers.
*/
fun PagesNavigation(): PagesNavigation =
DefaultPagesNavigation()