diff --git a/src/operator/MapToOperator.ts b/src/operator/MapToOperator.ts index 04c9692..5104448 100644 --- a/src/operator/MapToOperator.ts +++ b/src/operator/MapToOperator.ts @@ -4,12 +4,12 @@ import {Stream} from '../Stream'; import {emptyListener} from '../utils/emptyListener'; export class Proxy implements InternalListener { - constructor(public out: Stream, - public op: MapToOperator) { + constructor(private out: Stream, + private value: R) { } _n(t: T) { - this.out._n(this.op.projectedValue); + this.out._n(this.value); } _e(err: any) { @@ -22,14 +22,14 @@ export class Proxy implements InternalListener { } export class MapToOperator implements Operator { - public proxy: InternalListener = emptyListener; + private proxy: InternalListener = emptyListener; - constructor(public projectedValue: R, + constructor(private projectedValue: R, public ins: Stream) { } _start(out: Stream): void { - this.ins._add(this.proxy = new Proxy(out, this)); + this.ins._add(this.proxy = new Proxy(out, this.projectedValue)); } _stop(): void {