Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangfisher committed Jan 6, 2024
1 parent 179f9bb commit 0365e20
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 151 deletions.
12 changes: 6 additions & 6 deletions docs/docs/guide/reactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -791,10 +791,10 @@ const state = {
user:{
firstName:"Zhang",
lastName:"Fisher",
fullName: computed(async (user)=>{
fullNameX: computed(async (user)=>{
await delay()
return user.firstName+user.lastName
},["user.firstName","user.lastName"])
return "user.firstName+user.lastName"
},["user.firstName"])
}
}
const store = createStore<typeof state>({state})
Expand All @@ -804,10 +804,10 @@ export default ()=>{
return (<div>
<div>FirstName:{state.user.firstName}</div>
<div>LastName:{state.user.lastName}</div>
<div>FullName:{state.user.fullName.loading ? '正在计算' : state.user.fullName.value}</div>
<div>error:{state.user.fullName.error}</div>
<div>FullName:{state.user.fullNameX.loading ? '正在计算' : state.user.fullNameX.value}</div>
{/* <div>error:{state.user.fullName.error}</div> */}
<button onClick={setState((state)=>state.user.firstName=state.user.firstName+'.')}>修改FirstName</button>
<button onClick={()=>state.user.fullName.reset()}>重新计算</button>
<button onClick={()=>state.user.fullNameX.reset()}>重新计算</button>
</div>)
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
},
"dependencies": {
"color": "^4.2.3",
"helux": "^3.6.1",
"helux": "^4.0.2",
"helux-store": "workspace:^",
"speed-form": "workspace:^"
}
Expand Down
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"axios": "^1.6.2",
"classnames": "^2.3.2",
"color": "^4.2.3",
"helux": "^3.6.1",
"helux": "^4.0.2",
"helux-store": "workspace:^",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.42",
"@vitejs/plugin-react": "^4.2.1",
"helux": "^3.6.1",
"helux": "^4.0.2",
"jsdom": "^23.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@testing-library/react": "^14.1.2",
"@types/react": "^18.2.42",
"@vitejs/plugin-react": "^4.2.1",
"helux": "^3.6.1",
"helux": "^4.0.2",
"jsdom": "^23.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Loading

0 comments on commit 0365e20

Please sign in to comment.