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

skipUntil.js 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. }
  9. return function (d, b) {
  10. extendStatics(d, b);
  11. function __() { this.constructor = d; }
  12. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  13. };
  14. })();
  15. Object.defineProperty(exports, "__esModule", { value: true });
  16. var OuterSubscriber_1 = require("../OuterSubscriber");
  17. var InnerSubscriber_1 = require("../InnerSubscriber");
  18. var subscribeToResult_1 = require("../util/subscribeToResult");
  19. function skipUntil(notifier) {
  20. return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
  21. }
  22. exports.skipUntil = skipUntil;
  23. var SkipUntilOperator = (function () {
  24. function SkipUntilOperator(notifier) {
  25. this.notifier = notifier;
  26. }
  27. SkipUntilOperator.prototype.call = function (destination, source) {
  28. return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
  29. };
  30. return SkipUntilOperator;
  31. }());
  32. var SkipUntilSubscriber = (function (_super) {
  33. __extends(SkipUntilSubscriber, _super);
  34. function SkipUntilSubscriber(destination, notifier) {
  35. var _this = _super.call(this, destination) || this;
  36. _this.hasValue = false;
  37. var innerSubscriber = new InnerSubscriber_1.InnerSubscriber(_this, undefined, undefined);
  38. _this.add(innerSubscriber);
  39. _this.innerSubscription = innerSubscriber;
  40. subscribeToResult_1.subscribeToResult(_this, notifier, undefined, undefined, innerSubscriber);
  41. return _this;
  42. }
  43. SkipUntilSubscriber.prototype._next = function (value) {
  44. if (this.hasValue) {
  45. _super.prototype._next.call(this, value);
  46. }
  47. };
  48. SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  49. this.hasValue = true;
  50. if (this.innerSubscription) {
  51. this.innerSubscription.unsubscribe();
  52. }
  53. };
  54. SkipUntilSubscriber.prototype.notifyComplete = function () {
  55. };
  56. return SkipUntilSubscriber;
  57. }(OuterSubscriber_1.OuterSubscriber));
  58. //# sourceMappingURL=skipUntil.js.map