UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

17 lines 590 B
import { operate } from '../util/lift'; import { OperatorSubscriber } from './OperatorSubscriber'; export function every(predicate, thisArg) { return operate((source, subscriber) => { let index = 0; source.subscribe(new OperatorSubscriber(subscriber, (value) => { if (!predicate.call(thisArg, value, index++, source)) { subscriber.next(false); subscriber.complete(); } }, () => { subscriber.next(true); subscriber.complete(); })); }); } //# sourceMappingURL=every.js.map