Variable: registerRootStore
const registerRootStore: <T>(node) => T;
Registers a model / tree node object as a root store tree. Marking a model object as a root store tree serves several purposes:
- It allows the
onAttachedToRootStorehook (plus disposer) to be invoked on models once they become part of this tree. These hooks can be used for example to attach effects and serve as some sort of initialization. - It allows auto detachable references to work properly.
Type Parameters
| Type Parameter | Description |
|---|---|
T extends object | Object type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
node | T | Node object to register as root store. |
Returns
T
The same model object that was passed.