UNPKG

keep-vue

Version:

Keep Vue is an open-source component library built on top of Vue3 and Tailwind CSS. It offers a collection of pre-designed UI components and styles that you can easily integrate into your web applications.

14 lines (13 loc) 521 B
import { createInjectionState } from "@vueuse/core"; import {} from "vue"; const calendarStoreKey = "calendar-store"; const [useProvideCalender, useInjectCalendar] = createInjectionState((dayShape) => { return { dayShape }; }, { injectionKey: calendarStoreKey }); function useCalender() { const calendarState = useInjectCalendar(); if (!calendarState) throw new Error("useCalendar must be used within a <Calendar /> Component"); return calendarState; } export { useCalender, useProvideCalender };