provide-data
Pushes a batch of events into the store. Without reset, incoming records merge by id; with reset: true, the store clears its events and adds only the incoming batch. The existing EventsStore instance is reused. In Pro builds, every call clears the undo/redo history.
Usage
type ProvideDataPayload = {
data: { events: CalendarEvent[] };
reset?: boolean;
};
| Field | Type | Description |
|---|---|---|
data | { events: CalendarEvent[] } | Records to ingest. |
reset | boolean | When omitted or false, merge by id. When true, clear the event store and add only these. |
Trigger
api.exec("provide-data", { data: { events } });
Replace the full event set:
api.exec("provide-data", { data: { events }, reset: true });
Observe
api.on("provide-data", p => console.log(p.data.events.length, p.reset));
Intercept
api.intercept("provide-data", p => p.data.events.length > 0);
Returning false cancels the ingest before it reaches the store.
Component handler
<Calendar
events={[]}
date={new Date()}
onProvideData={p => console.log(p.data.events, p.reset)}
/>
Related articles
- Dynamic Loading — the range-loading pipeline that dispatches this action.
request-data— the range notification that precedes it.exec— programmatic dispatcher for this action.