UNPKG

mobx-keystone-mindreframer

Version:

A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more

10 lines (9 loc) 374 B
/** * Turns an object (array, plain object) into a tree node, * which then can accept calls to `getParent`, `getSnapshot`, etc. * If a tree node is passed it will return the passed argument directly. * * @param value Object to turn into a tree node. * @returns The object as a tree node. */ export declare function toTreeNode<T extends object>(value: T): T;