zustand store

This commit is contained in:
nabijonovdavronbek619@gmail.com
2025-12-11 19:56:38 +05:00
parent b3cf0c2a49
commit d684198ac4

23
lib/productZustand.ts Normal file
View File

@@ -0,0 +1,23 @@
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",
}
)
)
);