import { create } from "zustand"; import { devtools, persist } from "zustand/middleware"; import { CartTotal } from "@root/model/cart"; interface CartStore { cartTotal: CartTotal | null; setCartTotal: (newCartTotal: CartTotal) => void; } export const useCartStore = create()( devtools( // persist( (set, get) => ({ cartTotal: null, setCartTotal: newCartTotal => set({ cartTotal: newCartTotal }) }), // { // name: "cart", // getStorage: () => localStorage, // } // ), { name: "Cart store" } ) );