mobx-react-use-autorun 3.0.46 → 3.0.48

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.
Files changed (2) hide show
  1. package/README.md +8 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -59,7 +59,7 @@ Form validation<br/>
59
59
 
60
60
  export default observer(() => {
61
61
 
62
- const state = useMobxState(() => ({
62
+ const state = useMobxState({
63
63
  name: "",
64
64
  submit: false,
65
65
  errors: {
@@ -74,7 +74,7 @@ Form validation<br/>
74
74
  .some(s => (state.errors as any)[s]());
75
75
  }
76
76
  }
77
- }));
77
+ });
78
78
 
79
79
  async function ok(){
80
80
  state.submit = true;
@@ -107,7 +107,10 @@ The first:
107
107
 
108
108
  useMobxState({
109
109
  name: 'tom',
110
- age: 16
110
+ age: 16,
111
+ myInfo(){
112
+ return `${state.name}'s age is ${state.age}`
113
+ },
111
114
  }, {
112
115
  ...props,
113
116
  init: useIntl(),
@@ -118,11 +121,11 @@ is easy to use, you can define state and third-party hooks.<br/>
118
121
  The second:
119
122
 
120
123
  useMobxState(() => ({
124
+ name: 'tom',
125
+ age: 13,
121
126
  myInfo(){
122
127
  return `${state.name}'s age is ${state.age}`
123
128
  },
124
- name: 'tom',
125
- age: 13,
126
129
  }), {
127
130
  ...props,
128
131
  intl: useIntl(),
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"mobx-react-use-autorun","version":"3.0.46","description":"React Hook for mobx","scripts":{"test":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_test.ts","build":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_build.ts","make":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_make.ts"},"dependencies":{"mobx":"6.7.0","mobx-react-lite":"3.4.0","react-use":"17.4.0","rxjs":"7.5.7"},"peerDependencies":{"react":">=16.8.0"},"license":"MIT","keywords":["react","mobx","typescript"],"main":"./dist/index.js","types":"./dist/index.d.ts","eslintConfig":{"extends":["react-app","react-app/jest"]},"homepage":"https://github.com/zdu-strong/mobx-react-use-autorun#readme","repository":{"type":"git","url":"git+https://github.com/zdu-strong/mobx-react-use-autorun.git"},"files":["lib","dist"],"bugs":{"url":"https://github.com/zdu-strong/mobx-react-use-autorun/issues"},"publishConfig":{"registry":"https://registry.npmjs.org/"}}
1
+ {"name":"mobx-react-use-autorun","version":"3.0.48","description":"React Hook for mobx","scripts":{"test":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_test.ts","build":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_build.ts","make":"npx -y -p typescript -p ts-node ts-node --skipProject bin/mobx_react_make.ts"},"dependencies":{"mobx":"6.7.0","mobx-react-lite":"3.4.0","react-use":"17.4.0","rxjs":"7.8.0"},"peerDependencies":{"react":">=16.8.0"},"license":"MIT","keywords":["react","mobx","typescript"],"main":"./dist/index.js","types":"./dist/index.d.ts","eslintConfig":{"extends":["react-app","react-app/jest"]},"homepage":"https://github.com/zdu-strong/mobx-react-use-autorun#readme","repository":{"type":"git","url":"git+https://github.com/zdu-strong/mobx-react-use-autorun.git"},"files":["lib","dist"],"bugs":{"url":"https://github.com/zdu-strong/mobx-react-use-autorun/issues"},"publishConfig":{"registry":"https://registry.npmjs.org/"}}