StoreAfterDeleteHandler
See source codeHandler function called after a record has been successfully deleted from the store. Use this for cleanup operations and maintaining referential integrity.
type StoreAfterDeleteHandler<R extends UnknownRecord> = (
record: R,
source: 'remote' | 'user'
) => void
Example
const handler: StoreAfterDeleteHandler<ShapeRecord> = (shape, source) => {
// Clean up arrows that were connected to this shape
const connectedArrows = findArrowsConnectedTo(shape.id)
store.remove(connectedArrows.map((arrow) => arrow.id))
}
Parameters
Name | Description |
---|---|
| The record that was deleted |
| Whether the change originated from 'user' interaction or 'remote' synchronization |
Prev
StoreAfterCreateHandlerNext
StoreBeforeChangeHandler