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

    Variable useObjectsConst

    useObjects: <T extends Obj.Unknown>(
        refs: readonly Ref.Ref<T>[],
    ) => Obj.Snapshot<T>[]

    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 declaration

      • <T extends Obj.Unknown>(refs: readonly Ref.Ref<T>[]): Obj.Snapshot<T>[]
      • Type Parameters

        • T extends Obj.Unknown

        Parameters

        • refs: readonly Ref.Ref<T>[]

          Array of Refs to dereference and subscribe to

        Returns Obj.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.