docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Utilities that wrap business actions so they respect burst control, single-run setup, cached lookups, and deferred execution.
export type AsyncMaybe<T> = T | Promise<T>;
export type Notifier<TPayload> = {
trigger(payload: TPayload): void;
cancel(): void;
};
export function createBurstNotifier<TPayload>(
send: (payload: TPayload) => AsyncMaybe<void>,
quietWindowMs: number
): Notifier<TPayload>;
export function createOneTimeSetup<T>(setup: () => AsyncMaybe<T>): () => Promise<T>;
export function createCachedLookup<TKey, TValue>(
lookup: (key: TKey) => AsyncMaybe<TValue>,
makeKey?: (key: TKey) => string
): {
get(key: TKey): Promise<TValue>;
};
export function deferCall<TResult>(
fn: (...args: any[]) => AsyncMaybe<TResult>,
delayMs: number,
...args: any[]
): void;Provides call-frequency control, memoization, and deferred invocation utilities.