pairwise.js 504 B

123456789101112131415
  1. import { operate } from '../util/lift';
  2. import { createOperatorSubscriber } from './OperatorSubscriber';
  3. export function pairwise() {
  4. return operate(function (source, subscriber) {
  5. var prev;
  6. var hasPrev = false;
  7. source.subscribe(createOperatorSubscriber(subscriber, function (value) {
  8. var p = prev;
  9. prev = value;
  10. hasPrev && subscriber.next([p, value]);
  11. hasPrev = true;
  12. }));
  13. });
  14. }
  15. //# sourceMappingURL=pairwise.js.map