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

    Interface CDF

    The root store that manages all individual stores. GPT Context: This class serves as the root store, providing a single point of access to all individual stores within the application. It initializes and manages following instances of stores:

    • UserStore
    • DeviceStore
    • GroupStore
    • SubscriptionStore
    • AutomationStore
    interface CDF {
        automationStore: any;
        get config(): CDFconfig;
        set config(config: CDFconfig): void;
        groupStore: any;
        nodeStore: any;
        sceneStore: any;
        scheduleStore: any;
        sdkInstance: any;
        subscriptionStore: any;
        userStore: any;
        addStore(storeName: string, StoreClass: new (rootStore: CDF) => any): void;
        initialize(authInstance: any): Promise<void>;
    }
    Index

    Accessors

    automationStore: any
    groupStore: any
    nodeStore: any
    sceneStore: any
    scheduleStore: any
    sdkInstance: any
    subscriptionStore: any
    userStore: any

    Methods

    • Adds a custom store to the root store.

      Parameters

      • storeName: string

        The name of the custom store.

      • StoreClass: new (rootStore: CDF) => any

        The class of the custom store.

        GPT Context: This method allows developers to add custom store classes to the root store dynamically, providing flexibility to extend the store with additional functionality.

        Example:

        import { makeAutoObservable, action } from "mobx";
        import { CDF } from "./index";

        class CustomStore {
        rootStore: CDF;
        customValue = "custom value";

        constructor(rootStore: CDF) {
        this.rootStore = rootStore;
        makeAutoObservable(this);
        }

        @action setCustomValue(value: string) {
        this.customValue = value;
        }
        }

        store.addStore("customStore", CustomStore);

      Returns void

    • Parameters

      • authInstance: any

      Returns Promise<void>