wishthis/node_modules/rxjs/_esm2015/internal/operators/finalize.js

20 lines
616 B
JavaScript
Raw Normal View History

2022-05-29 09:24:36 +00:00
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
export function finalize(callback) {
return (source) => source.lift(new FinallyOperator(callback));
}
class FinallyOperator {
constructor(callback) {
this.callback = callback;
}
call(subscriber, source) {
return source.subscribe(new FinallySubscriber(subscriber, this.callback));
}
}
class FinallySubscriber extends Subscriber {
constructor(destination, callback) {
super(destination);
this.add(new Subscription(callback));
}
}
//# sourceMappingURL=finalize.js.map