reaxes-react 0.1.0 → 0.1.1

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/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.1.1
2
+ * 修复types和hooks type
3
+
1
4
  # 0.1.0
2
5
  * 新增`useReaxable` hook
3
6
 
package/esm/hooks.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"esm/hooks.js","mappings":"iDACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,sBCIlF,MAAM,EAJE,CAACI,IACR,IAAIC,EAAI,CAAC,EAAgC,OAA7Bf,EAAoBgB,EAAED,EAAGD,GAAWC,GAGZA,CAAE,CAAE,eAAoB,IAAOE,EAAiD,iBCArH,MAAM,EAJE,CAACH,IACR,IAAIC,EAAI,CAAC,EAAgC,OAA7Bf,EAAoBgB,EAAED,EAAGD,GAAWC,GAGZ,CAAE,CAAE,OAAY,IAAOG,EAAwC,SCJ7F,IAAMC,EAAc,SAAEC,GAAK,OAAMC,EAAAA,EAAAA,SAAQC,EAAAA,EAAAA,gBAAgBF,IAAUG,OAAO,E","sources":["webpack://mono-reaxes/webpack/bootstrap","webpack://mono-reaxes/webpack/runtime/define property getters","webpack://mono-reaxes/webpack/runtime/hasOwnProperty shorthand","webpack://mono-reaxes/external module \"reaxes\"","webpack://mono-reaxes/external module \"react\"","webpack://mono-reaxes/./packages/reaxes-react/src/hooks/useReaxable.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"createReaxable\"]: () => (__WEBPACK_EXTERNAL_MODULE_reaxes__.createReaxable) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useRef\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef) });","export const useReaxable = ( state ) => useRef( createReaxable( state ) ).current;\n\nimport { createReaxable } from 'reaxes';\nimport { useRef } from 'react';\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","x","d","__WEBPACK_EXTERNAL_MODULE_reaxes__","__WEBPACK_EXTERNAL_MODULE_react__","useReaxable","state","useRef","createReaxable","current"],"sourceRoot":""}
1
+ {"version":3,"file":"esm/hooks.js","mappings":"iDACA,IAAIA,EAAsB,CCA1BA,EAAwB,CAACC,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXF,EAAoBI,EAAEF,EAAYC,KAASH,EAAoBI,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDH,EAAwB,CAACS,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,I,sBCIlF,MAAM,EAJE,CAACI,IACR,IAAIC,EAAI,CAAC,EAAgC,OAA7Bf,EAAoBgB,EAAED,EAAGD,GAAWC,GAGZA,CAAE,CAAE,eAAoB,IAAOE,EAAiD,iBCArH,MAAM,EAJE,CAACH,IACR,IAAIC,EAAI,CAAC,EAAgC,OAA7Bf,EAAoBgB,EAAED,EAAGD,GAAWC,GAGZ,CAAE,CAAE,OAAY,IAAOG,EAAwC,SCJ7F,IAAMC,EAAc,SAAoBC,GAAS,OAAMC,EAAAA,EAAAA,SAAQC,EAAAA,EAAAA,gBAAgBF,IAAUG,OAAO,E","sources":["webpack://mono-reaxes/webpack/bootstrap","webpack://mono-reaxes/webpack/runtime/define property getters","webpack://mono-reaxes/webpack/runtime/hasOwnProperty shorthand","webpack://mono-reaxes/external module \"reaxes\"","webpack://mono-reaxes/external module \"react\"","webpack://mono-reaxes/./packages/reaxes-react/src/hooks/useReaxable.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"createReaxable\"]: () => (__WEBPACK_EXTERNAL_MODULE_reaxes__.createReaxable) });","var x = (y) => {\n\tvar x = {}; __webpack_require__.d(x, y); return x\n} \nvar y = (x) => (() => (x))\nconst __WEBPACK_NAMESPACE_OBJECT__ = x({ [\"useRef\"]: () => (__WEBPACK_EXTERNAL_MODULE_react__.useRef) });","export const useReaxable = <S extends object>( state : S ) => useRef( createReaxable( state ) ).current;\n\nimport { createReaxable } from 'reaxes';\nimport { useRef } from 'react';\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","y","x","d","__WEBPACK_EXTERNAL_MODULE_reaxes__","__WEBPACK_EXTERNAL_MODULE_react__","useReaxable","state","useRef","createReaxable","current"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "reaxes-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Combine React with Reaxes, automatically re-render React components when the data in the store changes.",
5
- "main": "esm/index.js",
6
- "module": "esm/index.js",
7
- "types": "types/index.d.ts",
8
5
  "author": "Kane",
9
6
  "license": "WTFPL",
7
+ "types": "./types/index.d.ts",
8
+ "typesVersions": {
9
+ "*": {
10
+ "hooks": [
11
+ "./types/hooks/index.d.ts"
12
+ ]
13
+ }
14
+ },
10
15
  "exports": {
11
16
  ".": {
12
17
  "import": "./esm/index.js",
@@ -1,6 +1,6 @@
1
- export declare const useReaxable: (state: any) => {
2
- store: any;
3
- mutate: <T extends (store: any) => void>(callback: T) => any;
4
- setState: (partialState: Partial<any>) => any;
5
- mergeState: (partialState: Partial<any>) => any;
1
+ export declare const useReaxable: <S extends object>(state: S) => {
2
+ store: S;
3
+ mutate: <T extends (store: S) => void>(callback: T) => S;
4
+ setState: (partialState: Partial<S>) => S;
5
+ mergeState: (partialState: Partial<S>) => S;
6
6
  };