aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/dist/esm/internal/operators/pairwise.js
blob: bec8fd806039faa6e33cf6164adf13dd3a74a828 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function pairwise() {
    return operate((source, subscriber) => {
        let prev;
        let hasPrev = false;
        source.subscribe(createOperatorSubscriber(subscriber, (value) => {
            const p = prev;
            prev = value;
            hasPrev && subscriber.next([p, value]);
            hasPrev = true;
        }));
    });
}
//# sourceMappingURL=pairwise.js.map
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage