diff --git a/rune/Rune.ts b/rune/Rune.ts index 9669b7481..82bc8b661 100644 --- a/rune/Rune.ts +++ b/rune/Rune.ts @@ -87,9 +87,9 @@ export class Rune { } async *iter(runner: Runner = globalRunner) { + let time = runner.timeline.current const primed = runner.prime(this) primed.reference() - let time = runner.timeline.current try { while (time !== Infinity) { const receipt = new Receipt() @@ -366,6 +366,7 @@ class RunAsyncIter extends RunStream { super(runner) ;(async () => { for await (const value of fn()) { + if (!this.alive) break this.push(value) } this.finish()