diff --git a/packages/rstream/src/stream-merge.ts b/packages/rstream/src/stream-merge.ts index 38c4b50a0b..c751808ca9 100644 --- a/packages/rstream/src/stream-merge.ts +++ b/packages/rstream/src/stream-merge.ts @@ -81,13 +81,8 @@ export class StreamMerge extends Subscription { src, src.subscribe( { - next: (x) => { - if (x instanceof Subscription) { - this.add(x); - } else { - this.next(x); - } - }, + next: (x) => + x instanceof Subscription ? this.add(x) : this.next(x), done: () => this.markDone(src), __owner: this, }, @@ -96,7 +91,7 @@ export class StreamMerge extends Subscription { ); } - addAll(src: ISubscribable[]) { + addAll(src: Iterable>) { for (let s of src) { this.add(s); } @@ -121,7 +116,7 @@ export class StreamMerge extends Subscription { return false; } - removeAll(src: ISubscribable[]) { + removeAll(src: Iterable>) { let ok = true; for (let s of src) { ok = this.remove(s) && ok; @@ -129,7 +124,7 @@ export class StreamMerge extends Subscription { return ok; } - removeAllIDs(ids: string[]) { + removeAllIDs(ids: Iterable) { let ok = true; for (let id of ids) { ok = this.removeID(id) && ok;