Automerge Repo - v2.3.0-alpha.0
    Preparing search index...
    view: <T>(doc: Automerge.Doc<T>, heads: Automerge.Heads) => Automerge.Doc<T> = Automerge.view

    Type declaration

      • <T>(doc: Automerge.Doc<T>, heads: Automerge.Heads): Automerge.Doc<T>
      • Make an immutable view of an automerge document as at heads

        Type Parameters

        • T

          The type of the value contained in the document

        Parameters

        Returns Automerge.Doc<T>

        The document returned from this function cannot be passed to change. This is because it shares the same underlying memory as doc, but it is consequently a very cheap copy.

        Note that this function will throw an error if any of the hashes in heads are not in the document.