aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/dist/esm/internal/operators/takeWhile.js
blob: 1884fdac6d104dda52d7f58f906e85c89e1d3566 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function takeWhile(predicate, inclusive = false) {
    return operate((source, subscriber) => {
        let index = 0;
        source.subscribe(createOperatorSubscriber(subscriber, (value) => {
            const result = predicate(value, index++);
            (result || inclusive) && subscriber.next(value);
            !result && subscriber.complete();
        }));
    });
}
//# sourceMappingURL=takeWhile.js.map
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage