• A Svelte store for an Automerge document.

    Type Parameters

    • T

    Parameters

    • documentId: AutomergeUrl

      The Automerge document ID

    • Optional repo: Repo

      (Optional) The Automerge repo to use. If not provided, the repo will be retrieved from context.

    Returns {
        change: ((fn) => void);
        subscribe: ((this, run, invalidate?) => Unsubscriber);
    }

    A Svelte store for the Automerge document.

    • change: ((fn) => void)
        • (fn): void
        • Parameters

          Returns void

    • subscribe: ((this, run, invalidate?) => Unsubscriber)
        • (this, run, invalidate?): Unsubscriber
        • Subscribe on value changes.

          Parameters

          • this: void
          • run: Subscriber<Doc<T>>

            subscription callback

          • Optional invalidate: Invalidator<Doc<T>>

            cleanup callback

          Returns Unsubscriber