pairwise.js 651 B

12345678910111213141516171819
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.pairwise = void 0;
  4. var lift_1 = require("../util/lift");
  5. var OperatorSubscriber_1 = require("./OperatorSubscriber");
  6. function pairwise() {
  7. return lift_1.operate(function (source, subscriber) {
  8. var prev;
  9. var hasPrev = false;
  10. source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) {
  11. var p = prev;
  12. prev = value;
  13. hasPrev && subscriber.next([p, value]);
  14. hasPrev = true;
  15. }));
  16. });
  17. }
  18. exports.pairwise = pairwise;
  19. //# sourceMappingURL=pairwise.js.map