简易版 React hook store
极简 react store 管理工具 .
此版本(v4)属于 break change ,不兼容老版本 (v3) 。老版本 (v3) 的 使用的说明,请点击查询。
``bash`
npm install @zjxpcyc/react-tiny-store -S
`javascript
// store.js
import { create } from '@zjxpcyc/react-tiny-store';
const useCount = create(1);
export default useCount;
// 至此 store 定义结束
// 可以在任意的组件内使用这个 useCount hook
// app.jsx
import useCount from './store';
const App = () => {
const [count, setCount] = useCount();
return (
);
}
``
更多方式,请查询说明文档