wishthis/node_modules/rxjs/dist/esm5/internal/operators/pairwise.js

15 lines
504 B
JavaScript
Raw Normal View History

2022-06-08 10:36:39 +00:00
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function pairwise() {
return operate(function (source, subscriber) {
var prev;
var hasPrev = false;
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
var p = prev;
prev = value;
hasPrev && subscriber.next([p, value]);
hasPrev = true;
}));
});
}
//# sourceMappingURL=pairwise.js.map