Browse documentation

TaskOptions

Type. Task strategy and outcome callbacks.

Table of contents

Category

Type

Type import

ts
import type { TaskOptions } from "valyrian.js/tasks";

Public signature

ts
type TaskOptions<TArgs, TResult> = { strategy?: TaskStrategy; onSuccess?: (result: TResult, args: TArgs) => void; onError?: (error: unknown, args: TArgs) => void; };

Type usage

TaskOptions configures scheduling and callbacks while preserving argument and result types.

Defaults

strategy defaults to takeLatest. Both callbacks are optional.