interface / @typed/navigation/Blocking

UseBlockNavigationParams

Configures the optional Effectful predicate used before a transition is blocked.

Package version
1.0.0-beta.13
Category
Blocking policy
Since
1.0.0

Import

import { UseBlockNavigationParams } from "@typed/navigation/Blocking";

Signatures

export interface UseBlockNavigationParams<R = never> {
    readonly shouldBlock?: (event: BeforeNavigationEvent) => Effect.Effect<boolean, RedirectError | CancelNavigation, R>;
}

Why

Applications can restrict blocking to dirty forms or selected destinations while keeping that decision in the same typed Effect environment as their state.

Ownership and lifetime

This object acquires no resources. Its predicate runs in the Scope and captured context of {@link useBlockNavigation}; redirects and cancellations remain typed navigation control flow.

Property: shouldBlock

Decides Effectfully whether a proposed transition should be blocked.

Property: shouldBlock: Why

Dirty-state checks can use services and still redirect or cancel through typed control flow.

Property: shouldBlock: Ownership and lifetime

The blocker Scope owns this reactive member; observing it does not extend that Scope.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source