mobx-react-use-autorun 3.0.43 → 3.0.44

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.
@@ -1 +1,2 @@
1
- export declare function useMobxState<T extends Record<any, any>, P extends Record<any, any>>(state: T | (() => T), props?: P): T & P;
1
+ export declare function useMobxState<T extends Record<any, any>>(state: T | (() => T)): T;
2
+ export declare function useMobxState<T extends Record<any, any>, P extends Record<any, any>>(state: T | (() => T), props: P): T & P;
@@ -1 +1 @@
1
- {"version":3,"file":"useMobxState.js","sourceRoot":"","sources":["../../lib/lib/useMobxState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,UAAU,YAAY,CAAyD,KAAoB,EAAE,KAAS;IAChH,IAAM,SAAS,GAAG,kBAAkB,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAE,KAAa,CAAC,CAAC,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;IAEjG,WAAW,CAAC;;;QAER,IAAI,KAAK,EAAE;YACP,KAAK,IAAM,GAAG,IAAI,KAAK,EAAE;gBACrB,IAAI,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAI,MAAA,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAC,0CAAE,GAAG,CAAA,EAAE;oBAC9E,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,GAAG,EAAE,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,GAAG,CAAQ,CAAC,CAAA;iBAC5F;qBAAM;oBACH,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,GAAG,CAAC,EAAE;wBAC/B,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;wBACv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vE;iBACJ;aACJ;SACJ;IACL,CAAC,CAAC,CAAA;IAEF,OAAO,SAAgB,CAAC;AAC5B,CAAC"}
@@ -1,6 +1,9 @@
1
1
  import { extendObservable, remove, isObservable, runInAction } from 'mobx';
2
2
  import { useLocalObservable } from 'mobx-react-lite';
3
3
 
4
+ export function useMobxState<T extends Record<any, any>>(state: T | (() => T)): T;
5
+ export function useMobxState<T extends Record<any, any>, P extends Record<any, any>>(state: T | (() => T), props: P): T & P;
6
+
4
7
  export function useMobxState<T extends Record<any, any>, P extends Record<any, any>>(state: T | (() => T), props?: P): T & P {
5
8
  const mobxState = useLocalObservable(typeof state === "function" ? (state as any) : () => state);
6
9
 
@@ -21,4 +24,4 @@ export function useMobxState<T extends Record<any, any>, P extends Record<any, a
21
24
  })
22
25
 
23
26
  return mobxState as any;
24
- }
27
+ }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"mobx-react-use-autorun","version":"3.0.43","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.44","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/"}}