You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
504 B
JavaScript

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