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:
946 bytes
|
Line | |
---|
1 | import { Subscriber } from '../Subscriber';
|
---|
2 | import { Notification } from '../Notification';
|
---|
3 | export function materialize() {
|
---|
4 | return function materializeOperatorFunction(source) {
|
---|
5 | return source.lift(new MaterializeOperator());
|
---|
6 | };
|
---|
7 | }
|
---|
8 | class MaterializeOperator {
|
---|
9 | call(subscriber, source) {
|
---|
10 | return source.subscribe(new MaterializeSubscriber(subscriber));
|
---|
11 | }
|
---|
12 | }
|
---|
13 | class MaterializeSubscriber extends Subscriber {
|
---|
14 | constructor(destination) {
|
---|
15 | super(destination);
|
---|
16 | }
|
---|
17 | _next(value) {
|
---|
18 | this.destination.next(Notification.createNext(value));
|
---|
19 | }
|
---|
20 | _error(err) {
|
---|
21 | const destination = this.destination;
|
---|
22 | destination.next(Notification.createError(err));
|
---|
23 | destination.complete();
|
---|
24 | }
|
---|
25 | _complete() {
|
---|
26 | const destination = this.destination;
|
---|
27 | destination.next(Notification.createComplete());
|
---|
28 | destination.complete();
|
---|
29 | }
|
---|
30 | }
|
---|
31 | //# sourceMappingURL=materialize.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.