We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zustand
userId
email
import { create } from "zustand"; import { persist } from 'zustand/middleware' //유저정보 export const useUserInfo = create( persist( (set) => ({ user: { email: null, userId: 0, }, setUser: (user) => set({ user }), }), { name:"user-info", getStorage:()=>localStorage, } ) )
import { useUserInfo } from "../store/useUserInfo.js"; const user = useUserInfo((state) => state.user); console.log(user.email);//유저의 이메일 console.log(user.userId);//유저의 고유id
The text was updated successfully, but these errors were encountered:
No branches or pull requests
구현내용
Zustand
저장소에userId
,email
이 저장됩니다.userId
를 통해 검색등 사용가능합니다.사용방법
The text was updated successfully, but these errors were encountered: