Files
spestexnika/store/subCategory.ts
nabijonovdavronbek619@gmail.com afe402a58a slide
2026-04-15 13:00:36 +05:00

28 lines
553 B
TypeScript

import { create } from "zustand";
// Type definition
interface SubCategory {
name: string;
id: number;
}
interface SubCategoryStore {
initialSubCategory: SubCategory;
setInitialSubCategory: (data: SubCategory) => void;
clearSubCategory: () => void;
}
export const useSubCategory = create<SubCategoryStore>((set) => ({
initialSubCategory: {
name: "",
id: 0,
},
setInitialSubCategory: (data) => set({ initialSubCategory: data }),
clearSubCategory: () =>
set({
initialSubCategory: { name: "", id: 0 },
}),
}));