container-x:用于React应用程序的简单和超轻量级状态管理

时间:2021-05-02 18:37:56
【文件属性】:
文件名称:container-x:用于React应用程序的简单和超轻量级状态管理
文件大小:5KB
文件格式:ZIP
更新时间:2021-05-02 18:37:56
JavaScript 容器-x 灵感来自未声明的库,但使用的方法不同,仅用35行代码编写。 安装 npm install container-x 用法 import { Container , Subscribe } from 'container-x' const store = new Container ( { foo : 'bar' } ) const App = props => { return ( < Subscribe xss=removed xss=removed> { foo => < div> { foo } < / div > } < / Subscribe > ) } // Some places else store . setState ( { foo : 'new value' } ) // Magic happe
【文件预览】:
container-x-master
----.gitignore(921B)
----tsconfig.json(188B)
----README.md(631B)
----LICENSE(1KB)
----package.json(1KB)
----src()
--------container-x.ts(1KB)
--------container-x.js(1KB)
----.eslintrc.js(1KB)

网友评论