MCPcopy Create free account
hub / github.com/astercloud/aster / updateValue

Function updateValue

ui/src/composables/useAsterDataBinding.ts:117–140  ·  view source on GitHub ↗

* Update the value in the data model

(newValue: DataValue)

Source from the content-addressed store, hash-verified

115 * Update the value in the data model
116 */
117 function updateValue(newValue: DataValue): void {
118 if (!isPath || !path || !context) {
119 return;
120 }
121
122 const doUpdate = () => {
123 if (context.processor.value) {
124 context.processor.value.setData(context.surfaceId, path, newValue);
125 }
126 else if (context.dataModel.value) {
127 setData(context.dataModel.value, path, newValue);
128 }
129 };
130
131 if (debounceMs > 0) {
132 if (debounceTimer) {
133 clearTimeout(debounceTimer);
134 }
135 debounceTimer = setTimeout(doUpdate, debounceMs);
136 }
137 else {
138 doUpdate();
139 }
140 }
141
142 return {
143 value,

Callers

nothing calls this directly

Calls 1

doUpdateFunction · 0.85

Tested by

no test coverage detected