userinfo_store.tsx 476 B

1234567891011121314151617
  1. import { create } from 'zustand';
  2. interface UserInfoState {
  3. userID: string;
  4. currentPrice: number | string;
  5. setUserID: (id: string) => void;
  6. setCurrentPrice: (price: number | string) => void;
  7. }
  8. const useUserInfoStore = create<UserInfoState>((set) => ({
  9. userID: '',
  10. currentPrice: 0,
  11. setUserID: (id: string) => set({ userID: id }),
  12. setCurrentPrice: (price: number | string) => set({ currentPrice: price })
  13. }));
  14. export default useUserInfoStore;