From 4494e1b96916750e04a82765d7c70b5db495bbab Mon Sep 17 00:00:00 2001 From: Simon Chan <1330321+yume-chan@users.noreply.github.com> Date: Fri, 22 Dec 2023 18:46:46 +0800 Subject: [PATCH] fix(stream): remove a duplicate call --- libraries/stream-extra/src/consumable.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/stream-extra/src/consumable.ts b/libraries/stream-extra/src/consumable.ts index 7a8ae48fa..5e7cec457 100644 --- a/libraries/stream-extra/src/consumable.ts +++ b/libraries/stream-extra/src/consumable.ts @@ -47,7 +47,7 @@ export class Consumable { this.#resolver.resolve(); } - error(error: any) { + error(error: unknown) { this.#resolver.reject(error); } @@ -55,7 +55,7 @@ export class Consumable { try { // eslint-disable-next-line @typescript-eslint/await-thenable const result = await this.#task.run(() => callback(this.value)); - this.consume(); + this.#resolver.resolve(); return result; } catch (e) { this.#resolver.reject(e); @@ -212,7 +212,6 @@ export class ConsumableWritableStream extends WritableStream> { await chunk.tryConsume( (value) => sink.write?.(value, controller), ); - chunk.consume(); }, abort(reason) { return sink.abort?.(reason);