Every new change
This commit is contained in:
37
node_modules/rxjs/_esm2015/internal/operators/exhaust.js
generated
vendored
Normal file
37
node_modules/rxjs/_esm2015/internal/operators/exhaust.js
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
import { OuterSubscriber } from '../OuterSubscriber';
|
||||
import { subscribeToResult } from '../util/subscribeToResult';
|
||||
export function exhaust() {
|
||||
return (source) => source.lift(new SwitchFirstOperator());
|
||||
}
|
||||
class SwitchFirstOperator {
|
||||
call(subscriber, source) {
|
||||
return source.subscribe(new SwitchFirstSubscriber(subscriber));
|
||||
}
|
||||
}
|
||||
class SwitchFirstSubscriber extends OuterSubscriber {
|
||||
constructor(destination) {
|
||||
super(destination);
|
||||
this.hasCompleted = false;
|
||||
this.hasSubscription = false;
|
||||
}
|
||||
_next(value) {
|
||||
if (!this.hasSubscription) {
|
||||
this.hasSubscription = true;
|
||||
this.add(subscribeToResult(this, value));
|
||||
}
|
||||
}
|
||||
_complete() {
|
||||
this.hasCompleted = true;
|
||||
if (!this.hasSubscription) {
|
||||
this.destination.complete();
|
||||
}
|
||||
}
|
||||
notifyComplete(innerSub) {
|
||||
this.remove(innerSub);
|
||||
this.hasSubscription = false;
|
||||
if (this.hasCompleted) {
|
||||
this.destination.complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=exhaust.js.map
|
Reference in New Issue
Block a user