setNext
Appends a handler to the end of the calendar's event bus chain. Used to attach a data provider so that add-event, update-event, and delete-event actions forward to a backend after the store handlers run.
Usage
setNext(handler: any): any;
Each call adds another link in the chain. RestDataProvider and other providers are valid handlers.
Example
<script>
import { Calendar, RestDataProvider } from "@svar-ui/svelte-calendar";
const provider = new RestDataProvider("/api");
const events = await provider.getData();
function init(api) {
api.setNext(provider);
}
</script>
<Calendar {events} date={new Date()} {init} />
Related articles
RestDataProvider— turn-key REST handler attached viasetNext.init— typical place to callsetNext.on— listen to actions after the provider runs.- Saving to a backend — full data-provider wiring.