import { create } from 'zustand'; import { devtools } from 'zustand/middleware'; import { usingStorage } from '@/hooks/usingStorage' export const useFormStore = create( devtools((set, get) => ({ formValues: {}, setFormValues: (values) => set((state) => ({ formValues: { ...state.formValues, ...values } })), formValuesToSub: { agency: usingStorage().travelAgencyId }, setFormValuesToSub: (values) => set((state) => ({ formValuesToSub: { ...state.formValuesToSub, ...values } })), cache: {}, setCache: (values) => set((state) => ({ cache: { ...state.cache, ...values } })), }), { name: 'formStore' }) ); export default useFormStore;