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

Method setData

ui/src/protocol/message-processor.ts:890–905  ·  view source on GitHub ↗

* Set data in a surface's data model

(surfaceId: string, path: string, value: DataValue)

Source from the content-addressed store, hash-verified

888 * Set data in a surface's data model
889 */
890 setData(surfaceId: string, path: string, value: DataValue): boolean {
891 const surface = this.surfaces.get(surfaceId);
892 if (!surface) {
893 return false;
894 }
895
896 const result = setData(surface.dataModel, path, value);
897
898 if (result && surface.rootComponentId) {
899 const streamingState = this.streamingStates.get(surfaceId);
900 this.rebuildComponentTree(surface, streamingState);
901 this.notifyListeners(surfaceId, surface);
902 }
903
904 return result;
905 }
906
907 /**
908 * Add data to a surface's data model

Callers 3

doUpdateFunction · 0.80

Calls 4

rebuildComponentTreeMethod · 0.95
notifyListenersMethod · 0.95
setDataFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected