Skip to content

Commit

Permalink
perf(skip): fast-path for skip over scalar observable
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Oct 14, 2015
1 parent d18e2bc commit 9b49936
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/observables/ScalarObservable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,11 @@ export default class ScalarObservable<T> extends Observable<T> {
count(): Observable<number> {
return new ScalarObservable(1);
}

skip(count: number): Observable<T> {
if (count > 0) {
return new EmptyObservable();
}
return this;
}
}

0 comments on commit 9b49936

Please sign in to comment.