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

    Function useObject

    Subscribe to an Echo object or Ref (entire object or specific property). Returns the current value accessor and an update callback.

    The Echo object or Ref to subscribe to (can be reactive)

    Optional property key to subscribe to a specific property

    A tuple of [accessor, updateCallback]

    • Subscribe to a Ref's target object. Automatically dereferences the ref and handles async loading. Returns undefined if the ref hasn't loaded yet.

      Type Parameters

      • T

      Parameters

      • ref: MaybeAccessor<Ref<T>>

        The Ref to dereference and subscribe to (can be reactive)

      Returns [Accessor<undefined | T>, ObjectUpdateCallback<T>]

      A tuple of [accessor, updateCallback]

    • Subscribe to a Ref's target object that may be undefined. Returns undefined if the ref is undefined or hasn't loaded yet.

      Type Parameters

      • T

      Parameters

      • ref: MaybeAccessor<undefined | Ref<T>>

        The Ref to dereference and subscribe to (can be undefined/reactive)

      Returns [Accessor<undefined | T>, ObjectUpdateCallback<T>]

      A tuple of [accessor, updateCallback]

    • Subscribe to an entire Echo object. Returns the current object value accessor and an update callback.

      Type Parameters

      • T extends Unknown

      Parameters

      • obj: MaybeAccessor<T>

        The Echo object to subscribe to (can be reactive)

      Returns [Accessor<ConditionalUndefined<T, T>>, ObjectUpdateCallback<T>]

      A tuple of [accessor, updateCallback]

    • Subscribe to an entire Echo object that may be undefined. Returns undefined if the object is undefined.

      Type Parameters

      • T extends Unknown

      Parameters

      • obj: MaybeAccessor<undefined | T>

        The Echo object to subscribe to (can be undefined/reactive)

      Returns [Accessor<ConditionalUndefined<T, T>>, ObjectUpdateCallback<T>]

      A tuple of [accessor, updateCallback]

    • Subscribe to a specific property of an Echo object. Returns the current property value accessor and an update callback.

      Type Parameters

      • T extends Unknown
      • K extends string | number | symbol

      Parameters

      • obj: MaybeAccessor<T>

        The Echo object to subscribe to (can be reactive)

      • property: K

        Property key to subscribe to

      Returns [Accessor<T[K]>, ObjectPropUpdateCallback<T[K]>]

      A tuple of [accessor, updateCallback]

    • Subscribe to a specific property of an Echo object that may be undefined. Returns undefined if the object is undefined.

      Type Parameters

      • T extends Unknown
      • K extends string | number | symbol

      Parameters

      • obj: MaybeAccessor<undefined | T>

        The Echo object to subscribe to (can be undefined/reactive)

      • property: K

        Property key to subscribe to

      Returns [Accessor<undefined | T[K]>, ObjectPropUpdateCallback<T[K]>]

      A tuple of [accessor, updateCallback]

    • Subscribe to a specific property of a Ref's target object. Automatically dereferences the ref and handles async loading. Returns undefined if the ref hasn't loaded yet.

      Type Parameters

      • T
      • K extends string | number | symbol

      Parameters

      • ref: MaybeAccessor<Ref<T>>

        The Ref to dereference and subscribe to (can be reactive)

      • property: K

        Property key to subscribe to

      Returns [Accessor<undefined | T[K]>, ObjectPropUpdateCallback<T[K]>]

      A tuple of [accessor, updateCallback]

    • Subscribe to a specific property of a Ref's target object that may be undefined. Returns undefined if the ref is undefined or hasn't loaded yet.

      Type Parameters

      • T
      • K extends string | number | symbol

      Parameters

      • ref: MaybeAccessor<undefined | Ref<T>>

        The Ref to dereference and subscribe to (can be undefined/reactive)

      • property: K

        Property key to subscribe to

      Returns [Accessor<undefined | T[K]>, ObjectPropUpdateCallback<T[K]>]

      A tuple of [accessor, updateCallback]