Skip to main content
Module

x/automerge/index.ts>next.from

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

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>