delRow
The delRow method lets you remove a single Row from a Table.
delRow(
tableId: string,
rowId: string,
): this| Type | Description | |
|---|---|---|
tableId | string | |
rowId | string | |
| returns | this | A reference to the |
If this is the last Row in its Table, then that Table will be removed.
Example
This example removes a Row from a Table.
import {createStore} from 'tinybase';
const store = createStore().setTables({
pets: {fido: {species: 'dog'}, felix: {species: 'cat'}},
});
store.delRow('pets', 'fido');
console.log(store.getTables());
// -> {pets: {felix: {species: 'cat'}}}
Since
v1.0.0