import { Operator } from '../Operator';
import { Subscriber } from '../Subscriber';
import { Observable } from '../Observable';
-import { OuterSubscriber } from '../OuterSubscriber';
-import { InnerSubscriber } from '../InnerSubscriber';
-import { subscribeToResult } from '../util/subscribeToResult';
import { MonoTypeOperatorFunction, TeardownLogic, ObservableInput } from '../types';
import { Subscription } from '../Subscription';
+import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe';
/**
* Returns an Observable that skips items emitted by the source Observable until a second Observable emits an item.
* @ignore
* @extends {Ignored}
*/
-class SkipUntilSubscriber<T, R> extends OuterSubscriber<T, R> {
+class SkipUntilSubscriber<T, R> extends SimpleOuterSubscriber<T, R> {
private hasValue: boolean = false;
- private innerSubscription: Subscription;
+ private innerSubscription?: Subscription;
constructor(destination: Subscriber<R>, notifier: ObservableInput<any>) {
super(destination);
- const innerSubscriber = new InnerSubscriber(this, undefined, undefined);
+ const innerSubscriber = new SimpleInnerSubscriber(this);
this.add(innerSubscriber);
this.innerSubscription = innerSubscriber;
- const innerSubscription = subscribeToResult(this, notifier, undefined, undefined, innerSubscriber);
+ const innerSubscription = innerSubscribe(notifier, innerSubscriber);
// The returned subscription will usually be the subscriber that was
// passed. However, interop subscribers will be wrapped and for
// unsubscriptions to chain correctly, the wrapper needs to be added, too.
}
}
- notifyNext(outerValue: T, innerValue: R,
- outerIndex: number, innerIndex: number,
- innerSub: InnerSubscriber<T, R>): void {
+ notifyNext(): void {
this.hasValue = true;
if (this.innerSubscription) {
this.innerSubscription.unsubscribe();