Skip to content

Commit

Permalink
feat(zipAll): add higher-order lettable version of zipAll
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonaden committed Sep 8, 2017
1 parent 509c97c commit f6bd51f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/operator/zipAll.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ZipOperator } from '../operators/zip';
import { Observable } from '../Observable';
import { zipAll as higherOrder } from '../operators/zipAll';

/**
* @param project
Expand All @@ -8,5 +8,5 @@ import { Observable } from '../Observable';
* @owner Observable
*/
export function zipAll<T, R>(this: Observable<T>, project?: (...values: Array<any>) => R): Observable<R> {
return this.lift(new ZipOperator(project));
return higherOrder(project)(this);
}
1 change: 1 addition & 0 deletions src/operators/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ export { windowToggle } from './windowToggle';
export { windowWhen } from './windowWhen';
export { withLatestFrom } from './withLatestFrom';
export { zip } from './zip';
export { zipAll } from './zipAll';
7 changes: 7 additions & 0 deletions src/operators/zipAll.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { ZipOperator } from './zip';
import { Observable } from '../Observable';
import { OperatorFunction } from '../interfaces';

export function zipAll<T, R>(project?: (...values: Array<any>) => R): OperatorFunction<T, R> {
return (source: Observable<T>) => source.lift(new ZipOperator(project));
}

0 comments on commit f6bd51f

Please sign in to comment.