Skip to main content
Module

x/abortable/mod.ts>Abortable

Abortable promises for Deno
Go to Latest
class Abortable
implements Abortable<T>
import { Abortable } from "https://deno.land/x/abortable@1.4/mod.ts";

Constructors

new
Abortable(promise: Promise<T>, aborter: AbortController)

Properties

readonly
[Symbol.toStringTag]

Methods

catch<TError = never>(onrejected?: ((reason: any) => TError | PromiseLike<TError>) | null)
finally(onfinally?: (() => void) | null)
then<TResult = T, TError = never>(onfullfilled?: ((value: T) => TResult | PromiseLike<TResult>) | null, onrejected?: ((reason: any) => TError | PromiseLike<TError>) | null)

Static Methods

create<T>(executor: (
resolve: (value?: T | PromiseLike<T>) => void,
reject: (reason?: any) => void,
signal?: AbortSignal,
) => (() => void) | void
)
interface Abortable
implements Promise<T>
import { type Abortable } from "https://deno.land/x/abortable@1.4/mod.ts";

Properties

readonly
promise: Promise<T>
readonly
aborter: AbortController

Methods

abort(): void
then<TResult = T, TError = never>(onfullfilled?: ((value: T) => TResult | PromiseLike<TResult>) | null, onrejected?: ((reason: any) => TError | PromiseLike<TError>) | null): Abortable<TResult | TError>
catch<TError = never>(onrejected?: ((reason: any) => TError | PromiseLike<TError>) | null): Abortable<TError>
finally(onfinally?: (() => void) | null): Abortable<T>