RoomStoreMethods
Deprecated: use the storage.transaction method instead
Interface for making transactional changes to room store data. Used within updateStore transactions to modify documents atomically.
interface RoomStoreMethods<R extends UnknownRecord = UnknownRecord> {}Example
await room.updateStore((store) => {
const shape = store.get("shape:123");
if (shape) {
store.put({ ...shape, x: shape.x + 10 });
}
store.delete("shape:456");
});Methods
delete
Delete a record from the store.
Parameters
| Name | Description |
|---|---|
| The record or record ID to delete |
Returns
void;get
Get a record by its ID.
Parameters
| Name | Description |
|---|---|
| The record ID |
Returns
null | R;The record or null if not found
getAll
Get all records in the store.
put
Add or update a record in the store.
Parameters
| Name | Description |
|---|---|
| The record to store |
Returns
void;Prev
RoomSnapshotNext
SessionStateSnapshot