MCPcopy
hub / github.com/microsoft/SandDance / applySignalValues

Function applySignalValues

packages/sanddance/src/signals.ts:6–15  ·  view source on GitHub ↗
(sv: SignalValues, b: Spec)

Source from the content-addressed store, hash-verified

4import { SignalValues } from '@msrvida/sanddance-specs';
5
6export function applySignalValues(sv: SignalValues, b: Spec) {
7 if (!sv || !b || !b.signals || !b.signals.length) return;
8 for (const key in sv) {
9 const value = sv[key];
10 const signalB = b.signals.filter(signal => signal.name === key)[0] as NewSignal;
11 if (signalB && signalB.bind) {
12 signalB.value = value;
13 }
14 }
15}
16
17export function extractSignalValuesFromView(view: View, spec: Spec) {
18 if (!view || !spec || !spec.signals || !spec.signals.length) return;

Callers 1

renderNewLayoutMethod · 0.90

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected