@espressif/rainmaker-base-cdf
    Preparing search index...

    Indexable

    • [key: string]: any
    Index

    Constructors

    Properties

    treeSynced: boolean = false

    true once a full home sync has completed and nothing has marked the tree stale since. While true, user.syncHomeWithNodes() serves the store. Bookkeeping only, so deliberately not observable.

    Accessors

    currentHomeId: string | null
    dataSource: "network" | "snapshot"

    snapshot while the tree was restored from disk and no live sync has completed yet.

    groupsByIDMap: ESPCDFGroupsByIDMap
    issuedGroupSharingRequestsByIDMap: ESPCDFGroupSharingRequestsByIDMap
    receivedGroupSharingRequestsByIDMap: ESPCDFGroupSharingRequestsByIDMap
    sdkAdaptorGroupsPaginationMap: ESPSDKAdaptorGroupsPaginationMap
    sdkAdaptorIssuedGroupSharingRequestsPaginationMap: ESPSDKAdaptorGroupSharingRequestsPaginationMap
    sdkAdaptorReceivedGroupSharingRequestsPaginationMap: ESPSDKAdaptorGroupSharingRequestsPaginationMap

    Methods

    • Dynamically adds an observable property to the store.

      Parameters

      • propertyName: string

        The name of the property to add.

      • initialValue: any

        The initial value of the property.

      Returns void

    • Adds a newly created room (or other sub-group) under its parent. The room is made observable and attached like any group from a sync, so later edits on it re-render. A room already under the parent is merged in place.

      Parameters

      • parentId: string

        Home (or group) the room was created in

      • subGroup: ESPCDFGroup

        Freshly transformed room from the adaptor

      Returns ESPCDFGroup

      The store's instance of the room

    • Attaches fetched nodes to a group: upserts them into the node store, then points the group's nodeIds / nodeDetails at the store instances. When the group is a home, each room is filled from the same nodes by its nodeIds (a room's nodes are always a subset of its home's), so one fetch per home serves every room with no further calls.

      Parameters

      • groupId: string

        Home or room the nodes were fetched for

      • nodes: ESPCDFNode[]

        Freshly transformed nodes from the adaptor

      Returns void

    • Releases this store's entity subscriptions. Called by ESPCDF.dispose.

      Returns void

    • Marks the tree stale, so the next syncHomeWithNodes() fetches it.

      Returns void

    • The tree was just restored from disk: not synced, waiters hold until a live sync.

      Returns void

    • Records that a full home sync finished; releases snapshot waiters.

      Returns void

    • Applies plain field changes (name, description, custom data, ...) to a home or a room in place. Rooms are not top-level entries, so they are found by walking the tree.

      Parameters

      Returns void

    • Removes a node from all groups' nodes arrays Called when a node is deleted from nodeStore to maintain consistency

      Parameters

      • nodeId: string

        The ID of the node to remove from groups

      Returns void

    • Keeps only valid homes in the store (used after first page and each next page in home sync).

      Returns void

    • Replaces the group tree with groups while keeping the instances the UI already holds: groups (and sub-groups) with a known id are updated in place, new ones are added, and ids missing from groups are removed and detached.

      Parameters

      Returns void

    • Resolves when live data has replaced a snapshot; immediately when the data is already live.

      Parameters

      • timeoutMs: number

      Returns Promise<void>