4.6.1 • Published 1 day ago
@zjxpcyc/react-tiny-store v4.6.1
@zjxpcyc/react-tiny-store
极简 react
store
管理工具 .
此版本(v4)属于 break change
,不兼容老版本 (v3) 。老版本 (v3) 的 使用的说明,请点击查询。
安装
npm install @zjxpcyc/react-tiny-store -S
使用
// 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 (
<button onClick={() => setCount(x => x + 1)}>count is {count}</button>
);
}
更多方式,请查询说明文档
4.6.1
1 day ago
4.6.0
2 days ago
4.5.0
1 month ago
4.4.1
1 month ago
4.4.0
2 months ago
3.0.3
10 months ago
3.0.2
10 months ago
3.0.1
10 months ago
3.0.0
10 months ago
4.2.3
7 months ago
4.3.1
6 months ago
4.2.2
7 months ago
4.1.0
9 months ago
4.0.0
9 months ago
4.2.1
9 months ago
4.2.0
9 months ago
4.1.1
9 months ago
2.0.6
1 year ago
2.0.3
1 year ago
2.0.5
1 year ago
2.0.4
1 year ago
2.0.2
1 year ago
2.0.1
2 years ago
2.0.0
2 years ago
1.0.0
3 years ago