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 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { OuterSubscriber } from '../OuterSubscriber';
  2. import { InnerSubscriber } from '../InnerSubscriber';
  3. import { subscribeToResult } from '../util/subscribeToResult';
  4. export function skipUntil(notifier) {
  5. return (source) => source.lift(new SkipUntilOperator(notifier));
  6. }
  7. class SkipUntilOperator {
  8. constructor(notifier) {
  9. this.notifier = notifier;
  10. }
  11. call(destination, source) {
  12. return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
  13. }
  14. }
  15. class SkipUntilSubscriber extends OuterSubscriber {
  16. constructor(destination, notifier) {
  17. super(destination);
  18. this.hasValue = false;
  19. const innerSubscriber = new InnerSubscriber(this, undefined, undefined);
  20. this.add(innerSubscriber);
  21. this.innerSubscription = innerSubscriber;
  22. subscribeToResult(this, notifier, undefined, undefined, innerSubscriber);
  23. }
  24. _next(value) {
  25. if (this.hasValue) {
  26. super._next(value);
  27. }
  28. }
  29. notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
  30. this.hasValue = true;
  31. if (this.innerSubscription) {
  32. this.innerSubscription.unsubscribe();
  33. }
  34. }
  35. notifyComplete() {
  36. }
  37. }
  38. //# sourceMappingURL=skipUntil.js.map