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.

takeUntil.js 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
  2. import * as tslib_1 from "tslib";
  3. import { OuterSubscriber } from '../OuterSubscriber';
  4. import { subscribeToResult } from '../util/subscribeToResult';
  5. export function takeUntil(notifier) {
  6. return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
  7. }
  8. var TakeUntilOperator = /*@__PURE__*/ (function () {
  9. function TakeUntilOperator(notifier) {
  10. this.notifier = notifier;
  11. }
  12. TakeUntilOperator.prototype.call = function (subscriber, source) {
  13. var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
  14. var notifierSubscription = subscribeToResult(takeUntilSubscriber, this.notifier);
  15. if (notifierSubscription && !takeUntilSubscriber.seenValue) {
  16. takeUntilSubscriber.add(notifierSubscription);
  17. return source.subscribe(takeUntilSubscriber);
  18. }
  19. return takeUntilSubscriber;
  20. };
  21. return TakeUntilOperator;
  22. }());
  23. var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
  24. tslib_1.__extends(TakeUntilSubscriber, _super);
  25. function TakeUntilSubscriber(destination) {
  26. var _this = _super.call(this, destination) || this;
  27. _this.seenValue = false;
  28. return _this;
  29. }
  30. TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  31. this.seenValue = true;
  32. this.complete();
  33. };
  34. TakeUntilSubscriber.prototype.notifyComplete = function () {
  35. };
  36. return TakeUntilSubscriber;
  37. }(OuterSubscriber));
  38. //# sourceMappingURL=takeUntil.js.map