function Failure.onObserved
onObserved(observer: ObservedObserver | null): void

Installs a process-wide observer for every handled declared failure — the portable (browser-friendly) counterpart of subscribing to OBSERVED_CHANNEL_NAME. Single slot, one null check on the failure path, nothing retained; pass null to detach.

import * as Failure from './failure.ts';

const handled: string[] = [];
Failure.onObserved((failure) => handled.push(failure.code));
// … Task consumers (`result()`, `match`, `unwrapOr`, `recover`) report here as they classify
Failure.onObserved(null); // detach

Parameters

observer: ObservedObserver | null

Return Type

void

Usage

import { Failure } from "lib/task/index.ts";
const { onObserved } = Failure;