12345678910111213141516171819202122232425 |
- import { Subscriber } from '../Subscriber';
- export function pairwise() {
- return (source) => source.lift(new PairwiseOperator());
- }
- class PairwiseOperator {
- call(subscriber, source) {
- return source.subscribe(new PairwiseSubscriber(subscriber));
- }
- }
- class PairwiseSubscriber extends Subscriber {
- constructor(destination) {
- super(destination);
- this.hasPrev = false;
- }
- _next(value) {
- if (this.hasPrev) {
- this.destination.next([this.prev, value]);
- }
- else {
- this.hasPrev = true;
- }
- this.prev = value;
- }
- }
- //# sourceMappingURL=pairwise.js.map
|