Skip to content

Commit

Permalink
perf(take): add fast-path for take over scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed Oct 14, 2015
1 parent be61d52 commit 33053b1
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 @@ -100,4 +100,11 @@ export default class ScalarObservable<T> extends Observable<T> {
}
return this;
}

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

0 comments on commit 33053b1

Please sign in to comment.