Files
firma/lib/productZustand.ts
nabijonovdavronbek619@gmail.com d684198ac4 zustand store
2025-12-11 19:56:38 +05:00

24 lines
539 B
TypeScript

import { create } from "zustand";
import { devtools, persist } from "zustand/middleware";
interface ProductStore {
productName: string;
setProductName: (name: string) => void;
resetProductName: () => void;
}
export const useProductStore = create<ProductStore>()(
devtools(
persist(
(set) => ({
productName: "",
setProductName: (name: string) => set({ productName: name }),
resetProductName: () => set({ productName: "" }),
}),
{
name: "product-storage",
}
)
)
);