Automerge Repo - v2.5.2-alpha.5
    Preparing search index...
    • Experimental

      Parse a ref from a URL string.

      The URL's documentId must match the provided handle's documentId. Use findRef instead if you don't have the handle and need to look it up.

      This API is experimental and may change in future versions.

      Type Parameters

      • TValue = unknown

        The expected type of the value this ref points to (defaults to unknown)

      Parameters

      • handle: DocHandle<any>

        The document handle to use (must match URL's documentId)

      • url: RefUrl

        Full ref URL like "automerge:documentId/path#heads"

      Returns Ref<TValue>

      Error if URL's documentId doesn't match handle's documentId

      const ref = refFromUrl<string>(handle, "automerge:abc/todos/0/title" as RefUrl);
      ref.value(); // string | undefined