tasko/hooks/use-mobile-sidebar.ts

14 lines
304 B
TypeScript
Raw Permalink Normal View History

2024-02-16 01:49:19 +00:00
import { create } from 'zustand';
2024-02-15 02:30:10 +00:00
type MobileSidebarStore = {
isOpen: boolean;
onOpen: () => void;
onClose: () => void;
};
export const useMobileSidebar = create<MobileSidebarStore>((set) => ({
isOpen: false,
onOpen: () => set({ isOpen: true }),
onClose: () => set({ isOpen: false }),
}));