• Make a full writable copy of an automerge document

    Remarks

    Unlike view this function makes a full copy of the memory backing the document and can thus be passed to change. It also generates a new actor ID so that changes made in the new document do not create duplicate sequence numbers with respect to the old document. If you need control over the actor ID which is generated you can pass the actor ID as the second argument

    Type Parameters

    • T

      The type of the value contained in the document

    Parameters

    • doc: Doc<T>

      The document to clone

    • Optional _opts: string | InitOptions<T>

      Either an actor ID to use for the new doc or an InitOptions

    Returns Doc<T>

Generated using TypeDoc