### Install zustand-cookie-storage Source: https://github.com/nanotexnolagiya/zustand-cookie-storage/blob/main/readme.md Install the zustand-cookie-storage package using npm or yarn. ```bash npm install zustand-cookie-storage # or yarn add zustand-cookie-storage ``` -------------------------------- ### Create Zustand Store with Cookie Storage Source: https://github.com/nanotexnolagiya/zustand-cookie-storage/blob/main/readme.md Example demonstrating how to create a Zustand store using the cookieStorage middleware for persistence. It configures the store name, storage type, and partial state to be saved. ```javascript import { create } from "zustand"; import { createJSONStorage, persist } from "zustand/middleware"; import { cookieStorage } from "zustand-cookie-storage"; const useMainStore = create( persist( (...args) => ({ ...locationSlice(...args), ...profileSlice(...args), }), { name: "main", storage: createJSONStorage(() => cookieStorage), partialize(state) { return { basketIds: state.basketIds }; }, } ) ); export default useMainStore; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.