mobx-bonsai
    Preparing search index...

    Variable bindYjsToNodeConst

    bindYjsToNode: <T extends object>(
        __namedParameters: {
            yjsDoc: Doc;
            yjsObject: YjsStructure;
            yjsOrigin?: symbol;
        },
    ) => {
        dispose: Dispose;
        getYjsValueForNode: (node: object) => unknown;
        node: T;
        "[dispose]"(): void;
    } = ...

    Creates a node that is bound to a Y.js data structure. Y.js Map and Array instances are bound to MobX objects and arrays, respectively.

    Type declaration

      • <T extends object>(
            __namedParameters: {
                yjsDoc: Doc;
                yjsObject: YjsStructure;
                yjsOrigin?: symbol;
            },
        ): {
            dispose: Dispose;
            getYjsValueForNode: (node: object) => unknown;
            node: T;
            "[dispose]"(): void;
        }
      • Type Parameters

        • T extends object

        Parameters

        • __namedParameters: { yjsDoc: Doc; yjsObject: YjsStructure; yjsOrigin?: symbol }
          • yjsDoc: Doc

            The Y.js document.

          • yjsObject: YjsStructure

            The Y.js data structure to bind.

          • OptionalyjsOrigin?: symbol

            The Y.js origin symbol used for binding transactions. One will be automatically generated if not provided.

        Returns {
            dispose: Dispose;
            getYjsValueForNode: (node: object) => unknown;
            node: T;
            "[dispose]"(): void;
        }

        • dispose: Dispose

          Disposes the binding.

        • getYjsValueForNode: (node: object) => unknown

          Resolves the corresponding Y.js value for a given target node.

          Error if the target node is not found in the bound tree.

        • node: T

          The bound node.

        • [dispose]: function
          • Disposes the binding.

            Returns void