Skip to main content

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;
};
FieldTypeDescription
idEventIDEvent to remove.
rawIdEventIDRendered identifier, including any chunk or recurring-occurrence suffix; equals id for an ordinary event.
cascadebooleanMarks 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)} />