Skip to main content
Module

x/defer/src/defer.ts>Deferred#then

Robust TypeScript API for deferred handling of Promises. Supports event listeners and custom state-specific callbacks.
Latest
method Deferred.prototype.then
import { Deferred } from "https://deno.land/x/defer@0.6.0/src/defer.ts";

Type Parameters

optional
TResult1 extends T = T
optional
TResult2 = never

Parameters

onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>
onrejected: (reason: unknown) => TResult2 | PromiseLike<TResult2>

Type Parameters

optional
TResult1 extends T = T
optional
TResult2 = never

Parameters

onfulfilled: (value: T) => TResult1 | PromiseLike<TResult1>
optional
onrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null

Type Parameters

optional
TResult1 = T
optional
TResult2 = never

Parameters

optional
onfulfilled: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null
optional
onrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | undefined | null