Skip to content

Commit

Permalink
refactor(rstream): update StreamMerge method args
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jul 26, 2020
1 parent 0a182b0 commit da648af
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/rstream/src/stream-merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,8 @@ export class StreamMerge<A, B> extends Subscription<A, B> {
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,
},
Expand All @@ -96,7 +91,7 @@ export class StreamMerge<A, B> extends Subscription<A, B> {
);
}

addAll(src: ISubscribable<A>[]) {
addAll(src: Iterable<ISubscribable<A>>) {
for (let s of src) {
this.add(s);
}
Expand All @@ -121,15 +116,15 @@ export class StreamMerge<A, B> extends Subscription<A, B> {
return false;
}

removeAll(src: ISubscribable<A>[]) {
removeAll(src: Iterable<ISubscribable<A>>) {
let ok = true;
for (let s of src) {
ok = this.remove(s) && ok;
}
return ok;
}

removeAllIDs(ids: string[]) {
removeAllIDs(ids: Iterable<string>) {
let ok = true;
for (let id of ids) {
ok = this.removeID(id) && ok;
Expand Down

0 comments on commit da648af

Please sign in to comment.