beforeRoute
Observes attempts to leave the current route.
Table of contents
Category
Value
Import
jsimport { beforeRoute } from "valyrian.js/router";Public signature
ts(callback: RouteCallback): () => voidParameters
tscallback: RouteCallbackResult
ts() => voidObservable effects
Runs when leaving the current route and returns a function that unregisters the callback.
Errors
Throws RouterError when the router is not mounted or the call occurs outside a component context.