Make deadly reace return an abortable promise (types)

master
Kuba Orlik 4 years ago
parent a00c98679a
commit 25862a998c

@ -142,7 +142,7 @@ export default class AbortablePromise<T> implements Promise<T | null> {
static deadlyRace<L>( static deadlyRace<L>(
promises: AbortablePromise<L>[], promises: AbortablePromise<L>[],
should_kill_others: (arg: L) => Promise<boolean> = async () => true should_kill_others: (arg: L) => Promise<boolean> = async () => true
): Promise<L> { ): AbortablePromise<L> {
return new AbortablePromise(async function* (await_or_abort) { return new AbortablePromise(async function* (await_or_abort) {
return await_or_abort( return await_or_abort(
new Promise((resolve, _) => { new Promise((resolve, _) => {

Loading…
Cancel
Save