Skip to main content
Module

x/automerge/next.ts>from

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Go to Latest
function from
import { from } from "https://deno.land/x/automerge@2.2.0/next.ts";

Create an automerge document from a POJO

Examples

Example 1

const doc = automerge.from({
    tasks: [
        {description: "feed dogs", done: false}
    ]
})

Type Parameters

T extends Record<string, unknown>

Parameters

initialState: T | Doc<T>
  • The initial state which will be copied into the document
optional
_opts: ActorId | InitOptions<T>