@sovereignbase/convergent-replicated-list
    Preparing search index...

    Function __read

    Exports the live-view read primitive.

    • Reads the value at an index in the replica live view.

      Wasm resolves the visible index to a TypeScript-owned value reference. Mutating that value directly can mutate replica state and should only be done when the caller owns an independent value object. Out-of-bounds and empty list reads resolve to undefined instead of throwing.

      Type Parameters

      • T

      Parameters

      • targetIndex: number

        Index in the live list.

      • replica: CRListState<T>

        Replica to read from.

      Returns T | undefined

      • The live value at targetIndex, or undefined when no value is present.

      Time complexity: O(d), worst case O(n)

      • d = distance from the Wasm range cursor to target index
      • n = list size

      Space complexity: O(1)