RoomStoreMethods
See source codeInterface 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
voidget
Get a record by its ID.
Parameters
| Name | Description |
|---|---|
| The record ID |
Returns
null | RThe 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
voidPrev
RoomSnapshotNext
TLSyncLog