true while the tree was restored from disk and no live sync has completed yet.
Bumped by every store action, synchronizer and event handler that changes the home tree (groups, nodes, params). Cheap to watch: the snapshot persister reacts to this counter instead of tracking the whole tree.
Gets an SDK adaptor by identifier.
The identifier of the adaptor to retrieve
The SDK adaptor instance
Adds a custom store to the root store.
The name of the custom store.
The class of the custom store.
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);
Deletes the snapshot of the signed-in user (logout, account deletion).
Releases every entity subscription held by this instance's stores.
Each store owns its synchronizer as a private field, so teardown has to be forwarded store by store — there is no way to reach them from outside.
Returns the identifier of the currently active SDK adaptor, or null if none is set.
The active adaptor identifier, or null
Returns the currently selected home group, or undefined if none is set.
Returns nodes that belong to the current home's nodeIds.
Restores the tree from disk when the store is empty and a usable snapshot
exists for this adaptor and user. Returns true when something was restored.
Records that the home tree changed. Called by the stores, synchronizers and event handlers.
Saves the current tree to disk. Returns false when snapshots are off, there
is nothing to save, or the content already on disk is the same.
StaticdisposeTears down the singleton so the next initCDF builds a fresh one.
getInstance returns the cached instance and ignores the config it is
handed, so a host that needs to re-initialise against a DIFFERENT backend
(a deployment switch) must clear the singleton first or it silently keeps
running on the previous backend's stores.
Staticget
The root store that manages all individual stores.