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