Skip to content

Commit

Permalink
upgrade README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
10019630 committed Apr 18, 2024
1 parent c2b3aac commit 8232258
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,16 @@ class AppClass extends ComponentWithStore {
const { userName } = this.userStore;
const { theme } = this.themeStore;
return (
<>
<span>{userName}</span>
<span>{theme}</span>
<button onClick={() => { this.userStore.userName = "LD" }}>
nameChange
</button>
<button onClick={() => { this.themeStore.setState({ theme: "light" }) }}>
themeChange
</button>
</>
<>
<span>{userName}</span>
<span>{theme}</span>
<button onClick={() => { this.userStore.userName = "LD" }}>
nameChange
</button>
<button onClick={() => { this.themeStore.setState({ theme: "light" }) }}>
themeChange
</button>
</>
);
}
}
Expand Down Expand Up @@ -1034,18 +1034,18 @@ function App() {
const { now } = useStore(timeStore);

return (
<>
<div>now:{now}</div>
<div
onClick={() => {
// time data now recover and also changed initial,
// because of initialState is function return.
store.restore();
}}
>
reset-btn
</div>
</>
<>
<div>now:{now}</div>
<div
onClick={() => {
// time data now recover and also changed initial,
// because of initialState is function return.
store.restore();
}}
>
reset-btn
</div>
</>
);
}
```
Expand All @@ -1057,15 +1057,15 @@ function App() {
```tsx
function App() {
return (
<button
onClick={() => {
// Use less scenes, use it with caution
// You can change the unmountRestore parameter setting of createStore
store.setOptions({ unmountRestore: false });
}}
>
btn
</button>
<button
onClick={() => {
// Use less scenes, use it with caution
// You can change the unmountRestore parameter setting of createStore
store.setOptions({ unmountRestore: false });
}}
>
btn
</button>
);
}
```
Expand Down

0 comments on commit 8232258

Please sign in to comment.