Package dev.fritz2.routing

Types

MapRoute
Link copied to clipboard
js
open class MapRoute(default: Map<String, String>) : Route<Map<String, String>>
MapRoute serializes and deserializes a Map to and from window.location.
MapRouter
Link copied to clipboard
js
open class MapRouter(defaultRoute: Map<String, String>) : Router<Map<String, String>>
Represents the current Route as Map of Strings.
Route
Link copied to clipboard
js
interface Route<T>
A Route is an abstraction for routes which needed for routing
Router
Link copied to clipboard
js
open class Router<T>(defaultRoute: Route<T>) : Store<T>
Router register the event-listener for hashchange-event and handles route-changes.
StringRoute
Link copied to clipboard
js
open class StringRoute(default: String) : Route<String>
StringRoute is a simple Route which serializes and deserializes nothing.

Functions

decodeURIComponent
Link copied to clipboard
js
external fun decodeURIComponent(encodedURI: String): String
encodeURIComponent
Link copied to clipboard
js
external fun encodeURIComponent(decodedURI: String): String
routerOf
Link copied to clipboard
js
fun <T> routerOf(default: Route<T>): Router<T>
Creates a new type based Router.
fun routerOf(default: String = ""): Router<String>
Creates a new simple String based Router
fun routerOf(default: Map<String, String> = emptyMap()): MapRouter
Creates a new Map based Router