Function registerRootStore

  • 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 onAttachedToRootStore hook (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

    • T extends object

    Parameters

    • node: T

      Node object to register as root store.

    Returns T

    The same model object that was passed.

    Typeparam

    T Object type.