Skip to content

async

async

Type Aliases

BatchOperationReduceOptions

type BatchOperationReduceOptions<TItem, TBatchOutput, TFinal> = BatchOperationSharedOptions & object;

Defined in: async/batch.ts:86

Run a per-batch handler and reduce batch outputs into a single value.

Type Declaration

collect
readonly collect: BatchCollectFn<TBatchOutput, TFinal>;
run
readonly run: BatchRunFn<TItem, TBatchOutput>;
source
readonly source: BatchSource<TItem>;

Type Parameters

Type Parameter
TItem
TBatchOutput
TFinal

SettledResult

type SettledResult<T> = object;

Defined in: async/index.ts:17

Type Parameters

Type Parameter
T

Properties

Property Type Defined in
fulfilled T[] async/index.ts:18
rejected unknown[] async/index.ts:19

Functions

allSettled()

function allSettled<T>(promises): Promise<SettledResult<T>>;

Defined in: async/index.ts:53

Type Parameters

Type Parameter
T

Parameters

Parameter Type
promises Promise<T>[]

Returns

Promise<SettledResult<T>>


delay()

function delay(ms): Promise<void>;

Defined in: async/index.ts:22

Parameters

Parameter Type
ms number

Returns

Promise<void>


withAbortableOperation()

function withAbortableOperation<T>(operation, options?): Promise<T>;

Defined in: async/index.ts:75

Type Parameters

Type Parameter
T

Parameters

Parameter Type
operation () => Promise<T>
options? { onAbort?: (error) => void; signal?: AbortSignal; }
options.onAbort? (error) => void
options.signal? AbortSignal

Returns

Promise<T>


withTimeout()

function withTimeout<T>(
   fn, 
   timeoutMs, 
label?): Promise<T>;

Defined in: async/index.ts:26

Type Parameters

Type Parameter
T

Parameters

Parameter Type
fn () => Promise<T>
timeoutMs number
label? string

Returns

Promise<T>

References

BatchCollectFn

Re-exports BatchCollectFn


BatchContext

Re-exports BatchContext


batchOperation

Re-exports batchOperation


BatchOperationFlatOptions

Re-exports BatchOperationFlatOptions


BatchOperationMapOptions

Re-exports BatchOperationMapOptions


BatchOperationOptions

Re-exports BatchOperationOptions


BatchOperationResult

Re-exports BatchOperationResult


BatchRunFn

Re-exports BatchRunFn


BatchSource

Re-exports BatchSource


BatchSourceItem

Re-exports BatchSourceItem


ItemsBatchSource

Re-exports ItemsBatchSource


itemsSource

Re-exports itemsSource


PaginatedBatchSource

Re-exports PaginatedBatchSource


paginatedSource

Re-exports paginatedSource