Browse documentation

afterRoute

Observes completed route changes.

Table of contents

Category

Value

Import

js
import { afterRoute } from "valyrian.js/router";

Public signature

ts
(callback: RouteCallback): () => void

Parameters

ts
callback: RouteCallback

Result

ts
() => void

Observable effects

Runs only after a successful route change, not during initial entry, 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.