Skip to main content

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 setup>
import { Calendar, RestDataProvider } from "@svar-ui/vue-calendar";

const provider = new RestDataProvider("/api");
const events = await provider.getData();

function init(api) {
api.setNext(provider);
}
</script>

<template>
<Calendar :events="events" :date="new Date()" :init="init" />
</template>
  • RestDataProvider — turn-key REST handler attached via setNext.
  • init — typical place to call setNext.
  • on — listen to actions after the provider runs.
  • Saving to a backend — full data-provider wiring.