Skip to content

Commit 8f1cafd

Browse files
committed
Update merge.ts
1 parent b26982a commit 8f1cafd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/asynciterable/merge.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ export class MergeAsyncIterable<T> extends AsyncIterableX<T> {
4242
nexts[index] = <Promise<MergeResult<IteratorResult<T>>>>NEVER_PROMISE;
4343
active--;
4444
} else {
45+
const iterator$ = iterators[index];
46+
nexts[index] = <Promise<MergeResult<IteratorResult<T>>>>NEVER_PROMISE;
4547
yield value$;
46-
nexts[index] = wrapPromiseWithIndex(iterators[index].next(), index);
48+
nexts[index] = wrapPromiseWithIndex(iterator$.next(), index);
4749
}
4850
}
4951
}

0 commit comments

Comments
 (0)