mobx-react-use-autorun 3.0.17 → 3.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,24 +12,35 @@ In the project directory, you can run:<br/>
|
|
|
12
12
|
|
|
13
13
|
### `npm test`
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Pre-step, please run<br/>
|
|
16
|
+
|
|
17
|
+
npm install
|
|
16
18
|
|
|
19
|
+
Run all unit tests.<br/>
|
|
17
20
|
|
|
18
21
|
### `npm run build`
|
|
19
22
|
|
|
23
|
+
Pre-step, please run<br/>
|
|
24
|
+
|
|
25
|
+
npm install
|
|
26
|
+
|
|
20
27
|
Builds the files for production to the `dist` folder.<br/>
|
|
21
28
|
|
|
22
29
|
### `npm publish`
|
|
23
30
|
|
|
31
|
+
Pre-step, please run<br/>
|
|
32
|
+
|
|
33
|
+
npm install
|
|
34
|
+
|
|
24
35
|
Publish to npm repository
|
|
25
36
|
|
|
26
|
-
## Notes - Define state with useMobxState
|
|
37
|
+
## Notes - Define state and props with useMobxState
|
|
27
38
|
|
|
28
39
|
import { useMobxState, observer } from 'mobx-react-use-autorun';
|
|
29
40
|
|
|
30
|
-
export default observer(() => {
|
|
41
|
+
export default observer((props: {name: string}) => {
|
|
31
42
|
|
|
32
|
-
const state = useMobxState({ randomNumber: 1 });
|
|
43
|
+
const state = useMobxState({ randomNumber: 1 }, {...props});
|
|
33
44
|
|
|
34
45
|
return <div onClick={() => state.randomNumber = Math.random()}>
|
|
35
46
|
{state.randomNumber}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-react-use-autorun",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.19",
|
|
4
4
|
"description": "React Hook for mobx",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm install -g typescript@4.6.3 @types/node@17.0.23 ts-node@10.7.0 cross-env@7.0.3 && cross-env TS_NODE_SKIP_PROJECT=true ts-node bin/mobx_react_build.ts",
|