@dxos/echo
    Preparing search index...

    Function readBranch

    • Returns what a read of one branch sees: the items of its ancestors up to each fork point, then the items of the branch itself. Omit branch for the root branch.

      A feed appended as A1, A2, A3, B1(fork at A2), A4, B2 reads A1, A2, A3, A4 on the root branch and A1, A2, B1, B2 on branch B1.

      items must be in append order, as read from the feed with branches: 'all'. The read is shallow when the base of a branch or its fork point is missing from items (a base or fork point that was updated is read at its latest block, which is not the one the branch names); the branch's own items are still returned. A walk (walk) reads blocks, so it has no such gap.

      Type Parameters

      Parameters

      • items: readonly T[]
      • Optionalbranch: string & Brand<"@dxos/echo/Feed/BranchId">

      Returns History<T>

      O(n) in items; one pass to group them and one walk up the branch's ancestors.