stax-monorepo
    Preparing search index...

    Interface Navigation

    Navigation service for managing browser history and route state.

    interface Navigation {
        back: () => Effect<void>;
        currentMatch: Readable.Readable<CurrentMatch>;
        forward: () => Effect<void>;
        lastSource: Readable.Readable<NavigationSource>;
        pathname: Readable.Readable<string>;
        pushPath: (path: string) => Effect<void>;
        pushRoute: <P, SP>(
            route: Route<string, P, SP, unknown, unknown, unknown>,
            options?: RouteNavigateOptions<P, SP>,
        ) => Effect<void>;
        replacePath: (path: string) => Effect<void>;
        replaceRoute: <P, SP>(
            route: Route<string, P, SP, unknown, unknown, unknown>,
            options?: RouteNavigateOptions<P, SP>,
        ) => Effect<void>;
        router: Router<any, any, any, any, any>;
        searchParams: Readable.Readable<URLSearchParams>;
    }
    Index
    back: () => Effect<void>

    Go back in history

    Current matched route (if any)

    forward: () => Effect<void>

    Go forward in history

    Which mechanism drove the most recent pathname change. Updated before pathname publishes, so subscribers reading both can rely on lastSource.get reflecting the source of the change they were woken for. null until the first navigation.

    pathname: Readable.Readable<string>

    Current pathname as a reactive readable

    pushPath: (path: string) => Effect<void>

    Navigate to a path string

    pushRoute: <P, SP>(
        route: Route<string, P, SP, unknown, unknown, unknown>,
        options?: RouteNavigateOptions<P, SP>,
    ) => Effect<void>

    Navigate to a route with type-safe params

    replacePath: (path: string) => Effect<void>

    Navigate to a path string, replacing current history entry

    replaceRoute: <P, SP>(
        route: Route<string, P, SP, unknown, unknown, unknown>,
        options?: RouteNavigateOptions<P, SP>,
    ) => Effect<void>

    Navigate to a route, replacing current history entry

    router: Router<any, any, any, any, any>

    The router this navigation is bound to

    searchParams: Readable.Readable<URLSearchParams>

    Current search params as a reactive readable