Nav3BrowserHistory

class Nav3BrowserHistory(pushState: (serializedState: String) -> Unit, replaceState: (serializedState: String) -> Unit, restoreState: (serializedState: String) -> Unit)

Coordinates serialized navigation snapshots with a platform browser-history adapter.

The caller owns serialization and the actual browser APIs. Browser history events should call restoreFromBrowser, while observed Nav3 state changes should call recordNavigation.

Constructors

Link copied to clipboard
constructor(pushState: (serializedState: String) -> Unit, replaceState: (serializedState: String) -> Unit, restoreState: (serializedState: String) -> Unit)

Functions

Link copied to clipboard
fun initialize(serializedState: String)

Replaces the current browser entry with the app's initial navigation state.

Link copied to clipboard
fun recordNavigation(serializedState: String)

Records a Nav3 state change as a new browser-history entry.

Link copied to clipboard
fun restoreFromBrowser(serializedState: String?): Boolean

Restores a state received from a browser history event.