hasRow
The hasRow method returns a boolean indicating whether a given Row exists in the Store.
hasRow(
tableId: string,
rowId: string,
): boolean| Type | Description | |
|---|---|---|
tableId | string | |
rowId | string | |
| returns | boolean |
Example
This example shows two simple Row existence checks.
import {createStore} from 'tinybase';
const store = createStore().setTables({pets: {fido: {species: 'dog'}}});
console.log(store.hasRow('pets', 'fido'));
// -> true
console.log(store.hasRow('pets', 'felix'));
// -> false
Since
v1.0.0