Skip to main content

request-data

Emitted by the store when the visible date range changes (Pro). It is notification-only - there's no built-in store handler. Subscribers such as RestDataProvider or a DynamicLoader catch it, fetch events for that range, and push them back with provide-data.

Usage

type RequestDataPayload = {
startDate: Date;
endDate: Date;
date: Date;
view: string;
};
FieldTypeDescription
startDateDateStart of the visible range (inclusive).
endDateDateEnd of the visible range (exclusive).
dateDateCurrent pivot date of the view.
viewstringActive view id ("day", "week", "month", ...).

The range is half-open: [startDate, endDate). The action fires only when startDate or endDate actually changes - a view switch that computes the same range emits nothing. The initial range is replayed after the init callback, so a provider attached there with api.setNext still receives the first request.

Observe

api.on("request-data", ({ startDate, endDate }) => {
loadEvents(startDate, endDate);
});

Component handler

<Calendar onrequestdata={p => loadEvents(p.startDate, p.endDate)} />