reox
v0.0.5
Published
sample react state management
Downloads
3
Readme
Reox
使用 react18 的 useSyncExternalStore 做的状态管理工具
快速上手
import reox from 'reox';
const store = reox({
count: 0,
});
export default function HomePage() {
const { count } = store;
return (
<div>
<p>{count}</p>
<div>
<button onClick={() => store.count++}>+</button>
<button onClick={() => store.count--}>-</button>
</div>
</div>
);
}