References
Store's references.
IMPORTANT
The references are not deep-reactive, you have to assign a new value to the reference when you want to update the data.
cellRef
The cellRef
function returns a writable reference to an object containing the value of a single Cell in a given Row, in a given Table, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Cell will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a readonly alternative to this reference called useCell
Parameters
tableId
(MaybeRefOrGetter
<string>
): The Id of the Table in the Store.rowId
(MaybeRefOrGetter
<string>
): The Id of the Row in the Table.cellId
(MaybeRefOrGetter
<string>
): The Id of the Cell in the Row.
Returns
WritableComputedRef<
CellOrUndefined
>
: A writable reference to the value of the Cell.
Example
rowRef
The rowRef
function returns a writable reference to the object containing the data of a single Row in a given Table, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Row will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a readonly alternative to this reference called useRow
Parameters
tableId
(MaybeRefOrGetter
<string>
): The Id of the Table in the Store.rowId
(MaybeRefOrGetter
<string>
): The Id of the Row in the Table.
Returns
WritableComputedRef<Row>
: A writable reference to an object containing the entire data of the Row.
Example
tableRef
The tableRef
function returns a writable reference to an object containing the data of a single Table in a Store, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Table will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a readonly alternative to this reference called useTable
Parameters
tableId
(MaybeRefOrGetter
<string>
): The Id of the Table in the Store.
Returns
WritableComputedRef<
Table
>
: A readonly reference to an object containing the entire data of the Table.
Example
tablesRef
The tablesRef
function returns a writable reference to a Tables object containing the tabular data of a Store, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Tables will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a readonly alternative to this function called useTables
Parameters
Returns
WritableComputedRef<
Tables
>
: A writable reference to the Tables object containing the tabular data of the Store.
Example
valueRef
The valueRef
function returns a writable reference to an object containing the data of a single Value in a Store, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Value will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a writable alternative to this function called useValue
Parameters
valueId
(MaybeRefOrGetter
<string>
): The Id of the Value in a Store.
Returns
WritableComputedRef<
Value
>
: A writable reference to the Value object containing the data of the Store.
Example
valuesRef
The valuesRef
function returns a writable reference to a Values object containing the keyed value data of a Store, and registers a listener so that any changes to that result will cause a re-render.
When first accessed, this function will create a listener so that changes to the Values will cause a re-render. When the component containing this reference is unmounted, the listener will be automatically removed.
NOTE
There's a readonly alternative to this function called useValues
Returns
WritableComputedRef<
Values
>
: A writable reference to a Values object containing the keyed value data of the Store.