Router

sealed external interface Router(source)

A Router instance manages all navigation and data loading/mutations

Properties

Link copied to clipboard
abstract val basename: String?
Link copied to clipboard
abstract val future: FutureConfig
Link copied to clipboard
Link copied to clipboard
abstract val state: RouterState
Link copied to clipboard
abstract val window: Window?

Functions

Link copied to clipboard
Link copied to clipboard
abstract fun createHref(location: Location<*>): String
abstract fun createHref(location: URL): String
Link copied to clipboard
abstract fun deleteBlocker(key: String)
Link copied to clipboard
abstract fun deleteFetcher(key: String)
Link copied to clipboard
abstract fun dispose()
Link copied to clipboard
abstract fun enableScrollRestoration(savedScrollPositions: ReadonlyRecord<String, Double>, getScrollPosition: GetScrollPositionFunction, getKey: GetScrollRestorationKeyFunction = definedExternally): () -> Unit
Link copied to clipboard
abstract fun encodeLocation(to: To): Path
Link copied to clipboard
abstract fun fetch(key: String, routeId: String, href: String?, opts: RouterFetchOptions = definedExternally)
Link copied to clipboard
abstract fun getBlocker(key: String, fn: BlockerFunction): Blocker
Link copied to clipboard
abstract fun <TData> getFetcher(key: String): Fetcher<TData>
Link copied to clipboard
abstract fun initialize(): Router
Link copied to clipboard
abstract fun navigate(to: Double): Promise<Void>

abstract fun navigate(to: To?, opts: RouterNavigateOptions = definedExternally): Promise<Void>

Navigate to the given path

Link copied to clipboard
abstract fun patchRoutes(routeId: String?, children: ReadonlyArray<AgnosticRouteObject>)
Link copied to clipboard
abstract fun revalidate()
Link copied to clipboard
abstract fun subscribe(fn: RouterSubscriber): () -> Unit