Skip to content

useTrackedAction

useTrackedAction<A, R>(name, fn, options?): TrackedAction<A, R>

Wrap an async action so its lifecycle is telemetered (plan 144 TASK-14 / REQ-21). run emits ${name}_started, then ${name}_completed on success or ${name}_failed (with a non-sensitive error_category) on throw — and preserves the return type and re-throws, so it is a drop-in wrapper. Events inherit the enclosing TelemetryScope; a missing provider makes the telemetry a no-op (AC-13) but never swallows the action.

A extends unknown[]

R

string

(…args) => R | Promise<R>

TrackOptions

TrackedAction<A, R>