1 import { Subscriber } from '../Subscriber';
2 export function filter(predicate, thisArg) {
3 return function filterOperatorFunction(source) {
4 return source.lift(new FilterOperator(predicate, thisArg));
8 constructor(predicate, thisArg) {
9 this.predicate = predicate;
10 this.thisArg = thisArg;
12 call(subscriber, source) {
13 return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
16 class FilterSubscriber extends Subscriber {
17 constructor(destination, predicate, thisArg) {
19 this.predicate = predicate;
20 this.thisArg = thisArg;
26 result = this.predicate.call(this.thisArg, value, this.count++);
29 this.destination.error(err);
33 this.destination.next(value);
37 //# sourceMappingURL=filter.js.map