Solid Automerge - v3.0.0
    Preparing search index...

    Function useDocument

    • get a fine-grained live view of a document, and its handle, from its url.

      const [doc, handle] = useDocument<{count: number}>(() => props.url)
      const inc = () => handle()?.change(doc => doc.count++)
      return <button onClick={inc}>{doc.count}</button>

      Type Parameters

      • T extends object

      Parameters

      Returns [doc: Doc<T>, handle: Accessor<DocHandle<T> | undefined>]

      [doc, handle]. doc is a * projection and handle is the useDocHandle memo