@dxos/echo
    Preparing search index...

    Function peek

    • Synchronous working-set read (see Ref.peek): the materialized target, or undefined — never throws and never triggers loading. Compose with load for a sync-when-materialized read with an async fallback, keeping the effect runnable under Effect.runSync when every ref is materialized (e.g. a mutation in a gesture frame):

      const task = Database.peek(ref) ?? (yield* Database.load(ref));
      

      Peek skips load's settling — a just-added object can resolve here before it has its own document — so callers that branch (or otherwise need a settled document) must load.

      Type Parameters

      • T

      Parameters

      • ref: Ref<T>

      Returns undefined | T

      O(1) working-set lookup; never loads and never throws.