Type Alias: DeferredAsyncOptions<ThisArg, Delay>
DeferredAsyncOptions<
ThisArg,Delay> =object&object&object|object&DeferredOptions<ThisArg>
Defined in: packages/promise/src/types/deferred.ts:26
Options for PromisE.deferred and other related functions
Type Declaration
delayMs?
optionaldelayMs:0|PositiveNumber<Delay>
Delay in milliseconds, used for debounce and throttle modes. Use 0 for sequential execution.
Use 0 to disable debounce/throttle and execute all operations sequentially.
Default: 100 (or whatever is set in PromisE.deferred.defaults.delayMs)
ignoreStale?
optionalignoreStale:boolean
Whether to ignore (based on resolveIgnored settings) stale promises. In debouce/throttle mode, when an older promise is resolved after a newly resolved promise, the older one is considered stale.
Default: false
onIgnore()?
optionalonIgnore: (this,ignored) =>ValueOrPromise<unknown>
Whenever a promise/function is ignored when in debounce/throttle mode, onIgnored wil be invoked. The promise/function will not be invoked, unless it's manually invoked using the ignored function. Use for debugging or logging purposes.
Parameters
this
ThisArg
ignored
GetPromiseFunc<unknown>
Returns
ValueOrPromise<unknown>
onResult()?
optionalonResult: (this,result?) =>ValueOrPromise<unknown>
Whenever a promise/function is executed successfully onResult will be called. Those that are ignored but resolve with last will not cause onResult to be invoked.
Result can be undefined if ResolveIgnored.WITH_UNDEFINED is used.
Parameters
this
ThisArg
result?
any
Returns
ValueOrPromise<unknown>
resolveError?
optionalresolveError:ResolveError
What do to when an executed function/promise throws error See ResolveError for available options.
resolveIgnored?
optionalresolveIgnored:ResolveIgnored
Indicates what to do when a promise in the queue is ignored. See ResolveIgnored for available options.
Type Parameters
ThisArg
ThisArg = unknown
Delay
Delay = unknown