getCellIds
The getCellIds method returns the Ids of every Cell in a given Row in a given Table.
getCellIds(
tableId: string,
rowId: string,
): Ids| Type | Description | |
|---|---|---|
tableId | string | |
rowId | string | |
| returns | Ids |
Note that this returns a copy of, rather than a reference, to the list of Ids, so changes made to the list are not made to the Store itself.
Examples
This example retrieves the Cell Ids in a Row.
import {createStore} from 'tinybase';
const store = createStore().setTables({
pets: {
fido: {species: 'dog', color: 'brown'},
},
});
console.log(store.getCellIds('pets', 'fido'));
// -> ['species', 'color']
This example retrieves the Cell Ids of a Row that does not exist, returning an empty array.
import {createStore} from 'tinybase';
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
console.log(store.getCellIds('pets', 'felix'));
// -> []
Since
v1.0.0