@dxos/echo-react
    Preparing search index...

    Function useObjects

    • Hook to subscribe to multiple Refs' target objects. Automatically dereferences each ref and handles async loading. Returns an array of loaded snapshots (filtering out undefined values).

      This hook is useful for aggregate computations like counts or filtering across multiple refs without using .target directly.

      Type Parameters

      • T extends Unknown

      Parameters

      • refs: readonly Ref<T>[]

        Array of Refs to dereference and subscribe to

      Returns Snapshot<T>[]

      Array of loaded target snapshots (excludes unloaded refs)

      Subscribes the component to the whole list, re-rendering on any element's change. Prefer pushing the subscription down — derive the aggregate in an atom (reading each Obj.atom(ref)) and read it where it is needed, or subscribe to the individual ref/property closest to the consumer — to keep subscriptions granular.