MCPcopy Create free account
hub / github.com/microsoft/SandDance / onStream

Function onStream

docs/app/js/sanddance-app.js:107933–107947  ·  view source on GitHub ↗
(df, stream1, target, update5, params, options)

Source from the content-addressed store, hash-verified

107931 return this;
107932}
107933function onStream(df, stream1, target, update5, params, options) {
107934 const opt = (0, _vegaUtil.extend)({}, options, SKIP);
107935 let func, op;
107936 if (!(0, _vegaUtil.isFunction)(target)) target = (0, _vegaUtil.constant)(target);
107937 if (update5 === undefined) func = (e)=>df.touch(target(e));
107938 else if ((0, _vegaUtil.isFunction)(update5)) {
107939 op = new Operator(null, update5, params, false);
107940 func = (e)=>{
107941 op.evaluate(e);
107942 const t = target(e), v = op.value;
107943 isChangeSet(v) ? df.pulse(t, v, options) : df.update(t, v, opt);
107944 };
107945 } else func = (e)=>df.update(target(e), update5, opt);
107946 stream1.apply(func);
107947}
107948function onOperator(df, source, target, update6, params, options) {
107949 if (update6 === undefined) source.targets().add(target);
107950 else {

Callers

nothing calls this directly

Calls 3

targetFunction · 0.70
isChangeSetFunction · 0.70
updateMethod · 0.45

Tested by

no test coverage detected