Skip to content

Function: useElement()

useElement(device, name, element): IndiElement | undefined

Subscribe to a single element of a property vector.

Sugar over useProperty for the common "I just want one value" case:

const ra = useElement("Telescope Simulator", "EQUATORIAL_EOD_COORD", "RA");
return <span>{ra?.kind === "number" ? formatNumber(ra.value, ra.format) : "-"}</span>;

Parameters

device

string

name

string

element

string

Returns

IndiElement | undefined

The element, or undefined until the property is defined.