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

Method addDataToSurface

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

* Add data to a surface's data model

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

Source from the content-addressed store, hash-verified

908 * Add data to a surface's data model
909 */
910 addDataToSurface(surfaceId: string, path: string, value: DataValue): boolean {
911 const surface = this.surfaces.get(surfaceId);
912 if (!surface) {
913 return false;
914 }
915
916 const result = addData(surface.dataModel, path, value);
917
918 if (result && surface.rootComponentId) {
919 const streamingState = this.streamingStates.get(surfaceId);
920 this.rebuildComponentTree(surface, streamingState);
921 this.notifyListeners(surfaceId, surface);
922 }
923
924 return result;
925 }
926
927 /**
928 * Remove data from a surface's data model

Callers

nothing calls this directly

Calls 4

rebuildComponentTreeMethod · 0.95
notifyListenersMethod · 0.95
addDataFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected