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

import { useRef } from "react";
import { Calendar } from "@wx/react-calendar";
import type { CalendarInstanceApi } from "@wx/react-calendar";

export default function App() {
const apiRef = useRef<CalendarInstanceApi>(null);

const logStore = () => {
const { data } = apiRef.current.getStores();
console.log(data);
};

return (
<>
<Calendar events={events} ref={apiRef} />
<button onClick={logStore}>Inspect store</button>
</>
);
}
  • getState — non-reactive snapshot for most use cases.
  • getReactiveState — reactive state per state field.
  • exec — preferred entry point for changing store state.