diff --git a/README.md b/README.md index 94d8a34..e537d05 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,20 @@ store((s) => ({ })); ``` +**None-state variables (Refs)** + +Actually it's not related to resso, it's just JavaScript. You can do it like this: + +```jsx +// store.js +export const refs = { + total: 0, +}; + +// App.js +import store, { refs } from './store'; +``` + --- **\* `react<18` batch update** diff --git a/README.zh-CN.md b/README.zh-CN.md index 3c0794b..c5dccd3 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -100,6 +100,20 @@ store((s) => ({ })); ``` +**非 state 变量 (Refs)** + +事实上它与 resso 无关,只是 JavaScript。你可以这样做: + +```jsx +// store.js +export const refs = { + total: 0, +}; + +// App.js +import store, { refs } from './store'; +``` + --- **\* `react<18` 批量更新**