1 | import {Transform} from 'vega-dataflow';
|
2 | import {inherits} from 'vega-util';
|
3 |
|
4 | /**
|
5 | * Proxy the value of another operator as a pure signal value.
|
6 | * Ensures no tuples are propagated.
|
7 | * @constructor
|
8 | * @param {object} params - The parameters for this operator.
|
9 | * @param {*} params.value - The value to proxy, becomes the value of this operator.
|
10 | */
|
11 | export default function Proxy(params) {
|
12 | Transform.call(this, null, params);
|
13 | }
|
14 |
|
15 | var prototype = inherits(Proxy, Transform);
|
16 |
|
17 | prototype.transform = function(_, pulse) {
|
18 | this.value = _.value;
|
19 | return _.modified('value')
|
20 | ? pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS)
|
21 | : pulse.StopPropagation;
|
22 | };
|