Entities
CDF entities are the stable, app-facing objects your UI calls. Each entity wraps SDK calls in operations, keeps the original SDK object in _raw, and emits operation events that drive store updates.
Use entity pages for task-oriented workflows (control a param, run a scene, share a group). Use domain stores for store maps, pagination, and session bootstrap.
tip
Do not construct entities in UI code — adaptors create them and stores hold observable instances.
Common Workflows
Subscribe to operation events on an entity
import { initCDF } from "@espressif/rainmaker-base-cdf";
const espCDF = await initCDF({ sdkAdaptorRegistry });
const node = espCDF.nodeStore.getNodeById("node-id");
const unsubscribe = node?.subscribe((n, op, success, _, err) => {
if (!success) console.error({ nodeId: n.id, op, err });
});
// Clean up when the screen unmounts
unsubscribe?.();
Per-entity guides are in the catalog below.