1 import { Subscriber } from '../Subscriber';
2 import { ArgumentOutOfRangeError } from '../util/ArgumentOutOfRangeError';
3 import { empty } from '../observable/empty';
4 export function take(count) {
10 return source.lift(new TakeOperator(count));
18 throw new ArgumentOutOfRangeError;
21 call(subscriber, source) {
22 return source.subscribe(new TakeSubscriber(subscriber, this.total));
25 class TakeSubscriber extends Subscriber {
26 constructor(destination, total) {
32 const total = this.total;
33 const count = ++this.count;
35 this.destination.next(value);
36 if (count === total) {
37 this.destination.complete();
43 //# sourceMappingURL=take.js.map