# BeforeNavigationHandler

Selects optional pre-commit work for a navigation event.

## Signatures

```ts
export type BeforeNavigationHandler<R, R2> = (event: BeforeNavigationEvent) => Effect.Effect<Option.Option<Effect.Effect<unknown, RedirectError | CancelNavigation, R2>>, RedirectError | CancelNavigation, R>;
```

## Why

The outer Effect decides whether a handler participates; the selected inner Effect can redirect
or cancel. This preserves declaration order and separates cheap selection from retained work.

## Ownership and lifetime

Registration captures the handler's Effect context and is owned by its Scope. The active
transition runs selected effects sequentially and interruption releases normal Effect resources.
