Automerge Repo - v2.3.0-alpha.0
    Preparing search index...

    The Automerge document store interface

    interface AutomergeDocumentStore<T> {
        documentId: DocumentId;
        handle: DocHandle<T>;
        url: AutomergeUrl;
        change(changeFn: ChangeFn<T>): void;
        set(this: void, value: T): void;
        subscribe(
            this: void,
            run: Subscriber<Automerge.Doc<T>>,
            invalidate?: () => void,
        ): Unsubscriber;
        update(this: void, updater: Updater<Automerge.Doc<T>>): void;
    }

    Type Parameters

    • T

    Hierarchy

    • Writable<Doc<T> | null>
      • AutomergeDocumentStore
    Index

    Properties

    documentId: DocumentId

    The ID of the document

    handle: DocHandle<T>

    The underlying Automerge document handle

    The URL of the document

    Methods

    • Set value and inform subscribers.

      Parameters

      • this: void
      • value: T

        to set

      Returns void

    • Subscribe on value changes.

      Parameters

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

        subscription callback

      • Optionalinvalidate: () => void

        cleanup callback

      Returns Unsubscriber

    • Update value using callback and inform subscribers.

      Parameters

      Returns void