2. x2beeStore
x2beeStore 사용방법
1
2
상태 저장 및 조회 예제
'use client';
import useTestStore from '@/lib/common/stores/testStore';
const TestPage = () => {
function setStore() {
useTestStore.setState({
test1: '11111',
test2: '22222',
test3: '3333'
});
}
function getStore() {
const store = useTestStore.getState();
console.log(store);
}
return (
<>
test2222
<button onClick={() => setStore()}>상태 저장</button>
<button onClick={() => getStore()}>상태 조회</button>
</>
);
};
export default TestPage;마지막 업데이트