没有合适的资源?快使用搜索试试~ 我知道了~
klyva:遵循React组件模型的状态管理库
共71个文件
tsx:21个
ts:20个
json:12个
需积分: 9 0 下载量 131 浏览量
2021-01-28
16:46:33
上传
评论
收藏 497KB ZIP 举报
温馨提示
:axe: Klyva React的可扩展状态管理。 最小的API,具有React性,可组合和可分解的状态! 如何 创建一个原子 可以通过给atom赋予一个值来构造基本原子。 const countAtom = atom ( 5 ) useAtom useAtom挂钩订阅对原子的更改,因此,如果对其进行了更新,则将通知并更新此组件。 该钩子与react的useState相似,因为它提供了setState函数。 const MyComponent = ( ) => { const [ value , setValue ] = useAtom ( countAtom ) const increase = ( ) => setValue ( oldValue => oldValue + 1 ) return < button onClick = { increase } > { value } < / button > } 组成 原子是可组合的。 这意味着您可以使用get函数将两个原子粘合在一起,当任何相关原子被更新时,派生的原子也会被更新: const atomO
资源推荐
资源详情
资源评论
收起资源包目录
klyva-master.zip (71个子文件)
klyva-master
.github
workflows
main.yml 834B
yarn.lock 303KB
src
index.tsx 202B
types.ts 695B
focus-atom.ts 3KB
react-utils.ts 4KB
atom-to-source.ts 439B
equal.ts 138B
localstorage-atom.ts 1KB
atom.ts 5KB
cached-subject.ts 2KB
examples
todo
makeFilterAtom.ts 543B
index.html 446B
index.tsx 570B
types.ts 109B
yarn.lock 229KB
favicon.ico 1KB
components
AtomCheckBox.tsx 647B
SmartTextInput.tsx 769B
TodoApp.tsx 1KB
ToggleAllButton.tsx 877B
FilterSelector.tsx 806B
RemainingIndicator.tsx 545B
ClearCompletedButton.tsx 534B
StaticFooter.tsx 459B
TodoItemForm.tsx 1KB
TodoItemView.tsx 899B
NewTodoInput.tsx 805B
TodoItem.tsx 814B
TodoList.tsx 802B
tsconfig.json 448B
makeTodoListAtom.ts 453B
.gitignore 36B
package.json 535B
mega-form
index.html 342B
index.tsx 5KB
yarn.lock 227KB
tsconfig.json 515B
.gitignore 24B
package.json 660B
react-derived-atoms
index.html 342B
index.tsx 683B
yarn.lock 226KB
tsconfig.json 448B
.gitignore 24B
package.json 613B
klyva-demo
index.html 342B
index.tsx 1KB
yarn.lock 226KB
tsconfig.json 448B
.gitignore 24B
package.json 613B
tsconfig.json 495B
LICENSE 1KB
test
use-selector.test.tsx 2KB
use-atom.test.tsx 8KB
atom.test.ts 5KB
localstorage-atom.test.ts 3KB
atom-iso.test.ts 392B
atom-prism.test.ts 2KB
tsconfig.json 73B
atom-perf.test.ts 1KB
use-array-slice.test.tsx 4KB
slice-atom-array.test.ts 4KB
atom-derived.test.ts 5KB
atom-readonly.test.ts 2KB
atom-to-source.test.ts 512B
README.md 4KB
.gitignore 41B
.codesandbox
ci.json 79B
package.json 3KB
共 71 条
- 1
资源评论
越昆
- 粉丝: 21
- 资源: 4598
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功