@@ -22,7 +22,7 @@ export class Combinator<T extends unknown[] = unknown[]> {
|
||||
constructor (fns: (CombinatorFunction | [CombinatorFunction, ...unknown[]])[], callback: CombinatorCallback<T>) {
|
||||
this.#callback = callback;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/require-await
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises, @typescript-eslint/require-await
|
||||
this.#subscriptions = fns.map(async (input, index): UnsubscribePromise => {
|
||||
const [fn, ...args] = Array.isArray(input)
|
||||
? input
|
||||
@@ -73,16 +73,19 @@ export class Combinator<T extends unknown[] = unknown[]> {
|
||||
|
||||
this.#isActive = false;
|
||||
|
||||
this.#subscriptions.map(async (subscription): Promise<void> => {
|
||||
try {
|
||||
const unsubscribe = await subscription;
|
||||
Promise
|
||||
.all(this.#subscriptions.map(async (subscription): Promise<void> => {
|
||||
try {
|
||||
const unsubscribe = await subscription;
|
||||
|
||||
if (isFunction(unsubscribe)) {
|
||||
unsubscribe();
|
||||
if (isFunction(unsubscribe)) {
|
||||
unsubscribe();
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
});
|
||||
})).catch(() => {
|
||||
// ignore, already ignored above, should never throw
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
"@polkadot/x-ws": "^12.6.2",
|
||||
"eventemitter3": "^5.0.1",
|
||||
"mock-socket": "^9.3.1",
|
||||
"nock": "^13.4.0",
|
||||
"nock": "^13.5.0",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Reference in New Issue
Block a user