Hi there,
Use the async APIs and ensure the incoming dataset has stable IDs (and assignments if you use AssignmentStore). Best options:
Replace the store atomically with loadDataAsync (preferred):
const newEvents = await fetch('/api/events').then(r => r.json()); await scheduler.eventStore.loadDataAsync(newEvents); // replaces and triggers calculationsOr set .data and wait for project to finish:
scheduler.eventStore.data = newEvents; await scheduler.project.commitAsync();
If you get duplicates, check that your server either:
- returns the same ids for existing events so they are updated, or
- you explicitly remove before loading: then
scheduler.eventStore.removeAll(); await scheduler.project.commitAsync();loadDataAsync(...).
If you use assignments / multi‑assignment update the AssignmentStore as well (or use CrudManager load/sync). See EventStoreMixin.loadDataAsync and the data property for details: