import { Subscription } from '../Subscription';
-import { OuterSubscriber } from '../OuterSubscriber';
-import { subscribeToResult } from '../util/subscribeToResult';
+import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
export function bufferWhen(closingSelector) {
return function (source) {
return source.lift(new BufferWhenOperator(closingSelector));
return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
}
}
-class BufferWhenSubscriber extends OuterSubscriber {
+class BufferWhenSubscriber extends SimpleOuterSubscriber {
constructor(destination, closingSelector) {
super(destination);
this.closingSelector = closingSelector;
super._complete();
}
_unsubscribe() {
- this.buffer = null;
+ this.buffer = undefined;
this.subscribing = false;
}
- notifyNext(outerValue, innerValue, outerIndex, innerIndex, innerSub) {
+ notifyNext() {
this.openBuffer();
}
notifyComplete() {
this.closingSubscription = closingSubscription;
this.add(closingSubscription);
this.subscribing = true;
- closingSubscription.add(subscribeToResult(this, closingNotifier));
+ closingSubscription.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));
this.subscribing = false;
}
}