reox
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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>
  );
}

Readme

Keywords

Package Sidebar

Install

npm i reox

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

242 kB

Total Files

19

Last publish

Collaborators

  • cnyballk