UNPKG

596 BJavaScriptView Raw
1import {Transform} from 'vega-dataflow';
2import {inherits} from 'vega-util';
3
4/**
5 * Operator whose value is simply its parameter hash. This operator is
6 * useful for enabling reactive updates to values of nested objects.
7 * @constructor
8 * @param {object} params - The parameters for this operator.
9 */
10export default function Params(params) {
11 Transform.call(this, null, params);
12}
13
14inherits(Params, Transform);
15
16Params.prototype.transform = function(_, pulse) {
17 this.modified(_.modified());
18 this.value = _;
19 return pulse.fork(pulse.NO_SOURCE | pulse.NO_FIELDS); // do not pass tuples
20};