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.
20 lines
616 B
20 lines
616 B
4 years ago
|
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
|