From 2c8238dab715c9a864eb8ad0646bf578a191918d Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Tue, 16 Jul 2024 17:40:53 +1000 Subject: [PATCH] fix: buffered map continuing on stream end --- .changeset/kind-trees-love.md | 5 +++++ src/stream/transforms.ts | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/kind-trees-love.md diff --git a/.changeset/kind-trees-love.md b/.changeset/kind-trees-love.md new file mode 100644 index 0000000..0b722b9 --- /dev/null +++ b/.changeset/kind-trees-love.md @@ -0,0 +1,5 @@ +--- +"windpipe": patch +--- + +fix: buffered map continuing on stream end diff --git a/src/stream/transforms.ts b/src/stream/transforms.ts index 25b069f..097a24d 100644 --- a/src/stream/transforms.ts +++ b/src/stream/transforms.ts @@ -380,6 +380,7 @@ export class StreamTransforms extends StreamConsumption { // Once the async iterator is exhausted, indicate that there will be no more items end = true; + itemReadySignal.done(); })(); // Create the resulting stream by pulling a value from the buffer whenever one is requested