Automerge Repo - v2.6.0-alpha.1
    Preparing search index...

    Interface DocumentProgress<T>

    Read-only view of a document query. Returned by Repo.findWithProgress

    interface DocumentProgress<T> {
        documentId: DocumentId;
        get error(): undefined | Error;
        get progress(): undefined | number;
        get state(): "loading" | "ready" | "unavailable" | "failed";
        peek(): QueryState<T>;
        subscribe(callback: (state: QueryState<T>) => void): () => void;
        whenReady(options?: { signal?: AbortSignal }): Promise<DocHandle<T>>;
    }

    Type Parameters

    • T
    Index

    Properties

    documentId: DocumentId

    Accessors

    • get state(): "loading" | "ready" | "unavailable" | "failed"

      Returns "loading" | "ready" | "unavailable" | "failed"

      read via peek().state. Will be removed in the next major release.

    Methods

    • Returns a promise that resolves with the DocHandle when the query reaches the ready state. Rejects if the query fails or the signal is aborted.

      Parameters

      • Optionaloptions: { signal?: AbortSignal }

      Returns Promise<DocHandle<T>>