Last change
on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
616 bytes
|
Line | |
---|
1 | import { Subscriber } from '../Subscriber';
|
---|
2 | import { Subscription } from '../Subscription';
|
---|
3 | export function finalize(callback) {
|
---|
4 | return (source) => source.lift(new FinallyOperator(callback));
|
---|
5 | }
|
---|
6 | class FinallyOperator {
|
---|
7 | constructor(callback) {
|
---|
8 | this.callback = callback;
|
---|
9 | }
|
---|
10 | call(subscriber, source) {
|
---|
11 | return source.subscribe(new FinallySubscriber(subscriber, this.callback));
|
---|
12 | }
|
---|
13 | }
|
---|
14 | class FinallySubscriber extends Subscriber {
|
---|
15 | constructor(destination, callback) {
|
---|
16 | super(destination);
|
---|
17 | this.add(new Subscription(callback));
|
---|
18 | }
|
---|
19 | }
|
---|
20 | //# sourceMappingURL=finalize.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.