delete-event
Removes an event from the calendar store. The matching onDeleteEvent callback fires after the event is removed.
Usage
type DeleteEventPayload = {
id: EventID;
rawId?: EventID;
cascade?: boolean;
};
| Field | Type | Description |
|---|---|---|
id | EventID | Event to remove. |
rawId | EventID | Rendered identifier, including any chunk or recurring-occurrence suffix; equals id for an ordinary event. |
cascade | boolean | Marks a follow-up delete emitted for a recurring master's exception. Metadata for providers and history; not set on a normal delete. |
EventID is string | number.
Deleting a recurring master cascades: after the master itself is removed, the action dispatches one delete-event per linked exception with cascade: true (the exception's canonical id as both id and rawId). Providers see each removal as its own action. Pro undo/redo history skips the cascade: true child deletes, since the master snapshot already restores them together.
Trigger
api.exec("delete-event", { id: 5 });
Observe
api.on("delete-event", p => console.log("deleted", p.id));
Intercept
api.intercept("delete-event", p => {
if (!confirm("Delete event?")) return false;
});
Component handler
<Calendar onDeleteEvent={p => console.log("deleted", p.id)} />
Related articles
add-event— counterpart for creating events.update-event— change without removing.intercept— confirm before deletion runs.- Editing — context-menu and editor delete flow.
- Recurring events — caveats for masters and exceptions.