CancellablePromise
Defined in: src/pattern/after.ts:9
Wait for delayMs, then execute factory() and return its eventual
value. The delay is cancellable via the returned Promise’s .cancel()
method — useful for building retry/timeout helpers.
factory is called once after the delay; if you need to re-evaluate on
each retry, pass a function that returns a fresh Promise each time.
Extends
Section titled “Extends”Promise<T>
Type Parameters
Section titled “Type Parameters”T
Properties
Section titled “Properties”[toStringTag]
Section titled “[toStringTag]”
readonly[toStringTag]:string
Defined in: docs/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:176
Inherited from
Section titled “Inherited from”Promise.[toStringTag]
Methods
Section titled “Methods”cancel()
Section titled “cancel()”cancel():
void
Defined in: src/pattern/after.ts:10
Returns
Section titled “Returns”void
catch()
Section titled “catch()”catch<
TResult>(onrejected?):Promise<T|TResult>
Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1564
Attaches a callback for only the rejection of the Promise.
Type Parameters
Section titled “Type Parameters”TResult
Section titled “TResult”TResult = never
Parameters
Section titled “Parameters”onrejected?
Section titled “onrejected?”((reason) => TResult | PromiseLike<TResult>) | null
The callback to execute when the Promise is rejected.
Returns
Section titled “Returns”Promise<T | TResult>
A Promise for the completion of the callback.
Inherited from
Section titled “Inherited from”Promise.catch
finally()
Section titled “finally()”finally(
onfinally?):Promise<T>
Defined in: docs/node_modules/typescript/lib/lib.es2018.promise.d.ts:29
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
Parameters
Section titled “Parameters”onfinally?
Section titled “onfinally?”(() => void) | null
The callback to execute when the Promise is settled (fulfilled or rejected).
Returns
Section titled “Returns”Promise<T>
A Promise for the completion of the callback.
Inherited from
Section titled “Inherited from”Promise.finally
then()
Section titled “then()”then<
TResult1,TResult2>(onfulfilled?,onrejected?):Promise<TResult1|TResult2>
Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:1557
Attaches callbacks for the resolution and/or rejection of the Promise.
Type Parameters
Section titled “Type Parameters”TResult1
Section titled “TResult1”TResult1 = T
TResult2
Section titled “TResult2”TResult2 = never
Parameters
Section titled “Parameters”onfulfilled?
Section titled “onfulfilled?”((value) => TResult1 | PromiseLike<TResult1>) | null
The callback to execute when the Promise is resolved.
onrejected?
Section titled “onrejected?”((reason) => TResult2 | PromiseLike<TResult2>) | null
The callback to execute when the Promise is rejected.
Returns
Section titled “Returns”Promise<TResult1 | TResult2>
A Promise for the completion of which ever callback is executed.
Inherited from
Section titled “Inherited from”Promise.then