Skip to main content

getStores

Returns the underlying store instances. Used by advanced integrations that need direct access to the store rather than the curated state snapshot.

Usage

getStores(): { data: CalendarStore };

Returns:

FieldTypeDescription
dataCalendarStoreInternal store holding events and view state.

Example

<script setup lang="ts">
import { ref } from "vue";
import { Calendar } from "@wx/vue-calendar";
import type { CalendarInstanceApi } from "@wx/vue-calendar";

const api = ref<CalendarInstanceApi | null>(null);

function logStore() {
const { data } = api.value.getStores();
console.log(data);
}
</script>

<template>
<Calendar :events="events" ref="api" />
<button :onclick="logStore">Inspect store</button>
</template>
  • getState — non-reactive snapshot for most use cases.
  • getReactiveState — reactive state per state field.
  • exec — preferred entry point for changing store state.