Skip to main content Link Search Menu Expand Document (external link)

Blocking overview

Added in v1.0.0


Table of contents


utils

BlockNavigation (interface)

Signature

export interface BlockNavigation extends RefSubject.Computed<Option.Option<Blocking>> {
  readonly isBlocking: RefSubject.Computed<boolean>
}

Added in v1.0.0

Blocking (interface)

Signature

export interface Blocking extends BeforeNavigationEvent {
  readonly cancel: Effect.Effect<Destination>
  readonly confirm: Effect.Effect<Destination>
  readonly redirect: (urlOrPath: string | URL, options?: NavigateOptions) => Effect.Effect<Destination>
}

Added in v1.0.0

UseBlockNavigationParams (interface)

Signature

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

Added in v1.0.0

useBlockNavigation

Signature

export declare const useBlockNavigation: <R = never>(
  params?: UseBlockNavigationParams<R>
) => Effect.Effect<BlockNavigation, never, Navigation | R | Scope.Scope>

Added in v1.0.0