{"_id":"redux-model-ts","_rev":"84-99a1ac413b21cc6c3cb474a6641f7b12","name":"redux-model-ts","dist-tags":{"latest":"3.6.0","next":"3.5.1-rc.1"},"versions":{"0.3.0":{"name":"redux-model-ts","version":"0.3.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-mix.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"dependencies":{"axios":"^0.18.0","tslib":"^1.9.3"},"description":"```bash yarn add redux-model-ts","bugs":{"url":"https://github.com/fwh1990/redux-mix/issues"},"homepage":"https://github.com/fwh1990/redux-mix#readme","_id":"redux-model-ts@0.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-OERw9x15Z/M/TPIsNANhbGODxGvdgXO8KzEKN8k639JRBpMxkkNTN0diNqwc8+MFYh134+ASKd/hTW7Hhw2k8g==","shasum":"b2c59a5dac65b5934d077a2000e307e54e2fdc3e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.3.0.tgz","fileCount":14,"unpackedSize":25243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc225MCRA9TVsSAnZWagAAz7sP/RfUKlTnDN6Fl2iyUk/X\nWQ8eJlqrAhW0FTCB/8Ek3hTjxji0RKnLotE9W6ql1hm/lQGdqQFXp0MBV0U5\ntO2Q9B2YSmDX6IsaaIMwFNSOjpdLjksy3KcaxS9KQe72YR5E21NZaTB6YDGW\nuetPKIyGJXtIwRji5MMlmT23UCFfAFOE+ZVKVd+8SjXfgW78fe8TRilyfi8Q\n5bb+Mc2rriuGg9Fn8kDz2pe8bxTNKTePCkXQWI4G91Mv8niYumvhS3/ze+hL\nJz3YB+lOhAwbiunRZHSMgenMwbL0w+tXuPuefON0q54cpbY9h7ZF2Q3YGzFN\n5eUBq7mkxovtF+N7wq8sLGYwfbbGmqmoMQ/UGsTSIOjHXK3emWkjwgCrdeHD\nSl8NaGJvvWI0H8Obn+1UWN7FzL2CzGtjLX8RpHiTp+JB8rbPR4Yqhxwe2xYj\nd7A2cuKxAw/Ds33yf4WMhWg8MKU+0O6w/Ce1yfrjoiRFshZfSJT6Urjpf/5Y\nKMi/Hj1xcizWWXkDbBvp1EwRwYhwximOGgqGmeIFdtYNdYQ4YoAeB/3NL/JH\nX72LfXHRD7d095zSVFP0oj/p3x8bKfYDbwKvgeiVdyS+6eH6OFA1VPnH/OXh\nuJgXL7LERl18q+4m0cHkPMEZdK+ZbFbA6MVweYpMTjOzl9PnY6Rzj2r/w16m\naT+/\r\n=2A+9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAHdo5afrgEm82ckogtgNsFSIVrqY/GyiFl/lKTGk6M0AiEAl9yLKsRl3Ve/3/DMByQr/UnfKe2P+M/15Nrv7//xcLU="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.3.0_1557884492449_0.2588996761459743"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.3.1":{"name":"redux-model-ts","version":"0.3.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-mix.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"dependencies":{"axios":"^0.18.0","tslib":"^1.9.3"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-mix/issues"},"homepage":"https://github.com/fwh1990/redux-mix#readme","_id":"redux-model-ts@0.3.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-sjRp4QPvInjuHs1ryRumtMouSuoxOGyop5A8DfEMJTwLtBZwxcwyjviMw5HB1eM5RHGFxlqWSRmTNBVPdrHNqQ==","shasum":"5902a1e867241b0732be0c86d3965fb976e9bfdd","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.3.1.tgz","fileCount":14,"unpackedSize":25486,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc23x6CRA9TVsSAnZWagAAA6MP/1b9ZmH5UtRYFT0qrdy1\nOfuRZjefnAlRFRkc7faTLjiFmCjbddhovTtpnGyrWQwhj7Y+m3iDOgF07Iw4\nywg5UgPBQ7Nb1bpIhNMjx7y58yuf4Jzeb3TTn04ZHmnM9kgVRjZJPizYdMf6\nFBEgu3ZjUHkQCAnSAmgz5lKLtu/QEHs2dG4IeMht4KL1Ekkm0OeI/iBwzKwt\nU7SF7k60PQo6Ttbyqv8Rldn7s/M5F6o/Z5WmOfuPjgptrcrbK3nhcXctCox3\n1cYhmQAbG93+QnnJY6E8bkAqDf+8XPIXN9KHxtSngX6bX0hYvptXM7hoeVAo\na7bxQ+4XyKKxWJU4wb0Fu5eeHJMn+zmVkryArDGFM1zhdhgnGNpoJyLT/SkG\n+N/rIvIHAorAFWv94b52UHkqXvz1TokyJftZJOS4u6yxFzQxu8fxbgeK0390\nwhKOu/D3+r7n0/OesftKomz7HG2IKlqMXN6m9LgDlwsD7chkejfj4OC3431V\nuSu+Yp183EGxOlyDX3xpDVROyZuow5E5p4zF6UIgVTFgm8/Xp3+MNEqTjsNI\nQ++HblbsMDCddTCjePM9ybTVPI2Cr97owJG6DHeHX7KLAz6O6NN0l74UuP+J\nCKKNgGjfy777lR7gbXlxrReC+n1jXrgXeMIqbS+LuJn1jCYnJanLrqrOoGn+\nooaa\r\n=Dn6I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBkZTFdFf7+uo5+pP9IYs2dsdajTHi02tZ5xModkduZ7AiEA4nXBBx9o+r5/ZhkLGMXjK46z4J9t1fuwFSlBDRK+f30="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.3.1_1557888121662_0.02223780679511944"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.4.0":{"name":"redux-model-ts","version":"0.4.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-mix.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"dependencies":{"axios":"^0.18.0","tslib":"^1.9.3"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-mix/issues"},"homepage":"https://github.com/fwh1990/redux-mix#readme","_id":"redux-model-ts@0.4.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-rWsRh2qbTigxh3Tb1WfR+fIrl9/mzD75t434vytnlts6nnz+RBrawBXgd9AX7NDvHfI8wVkk+QZUkUlaBXGEOw==","shasum":"7c7d287c0f4f54a95b532eda9266d6c969125852","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.4.0.tgz","fileCount":13,"unpackedSize":25084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc24dACRA9TVsSAnZWagAApgcP+QCg8ZPXrc1WtiM+CyBi\nzF4xYGQaxjX7C1wtjtR+hlgFRGWPsSu4u7Cto+zBzlD7E796sSW4+sK+wx0/\n3y3+0v2Sw56K/01vFjtue5kJV96cqulvJ7A6zRRw4kA+lUOl5rilccdpi0Um\nYGEfSWNOmsQH79+jqtFZtP61q/mljsFuznz0mx1aieiSEiq0I08G36ziNgUc\nQIXPuczpB9cNTsXxNp5c8k0qZGPoE3QbnkBKpJpxPJ0sf39FuklVgbRFWDRE\nx3fZa0wifKZ5k+zE//WTtOdgATOAtqrheIc/z0xouhbKYCbl5/u+XePhapve\na/uDT6meDXGQjxUubtO5bC/OJpZrjCDzrMH8kZohxFoJPL7nVwwBnyRQ+vJN\nhe5ILDYCEaOHzwBIwdBoa+RD9RNbDjU8wQt+TowFA/3obtmKjbtxc1zP2E49\n1H4weo7UNrYeGk48ZwK/Yj+qTC9xzWodreWTTQyRjyo2NskxknZmPPGKUZIg\nnVZq7jsU/xyt1SUbLDHw/NJMvLdO6A4sXZfGCHhF4BDI+sH+Mv1KSUjmFPE/\ndlbWo5l9euImDfuRZjfrbGwupUG9zAHvniMkCieU+JdzFJ8O5t5b8vnidN5B\nnFeYM0QNJ5RUe4GgvZpz8C8fFD7av3v9Tsq9pRrCGSxJ2mlBHViOuqGBJp4i\nN0oQ\r\n=spps\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+begH+FY/1sbCCC2TFGBhoPJDOI1rZ+VF+MJfCw3jvAIgV5VB2Q+moTouh+rRah5HUSmITe5bgN2O+9+3WGzhtPQ="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.4.0_1557890879793_0.7120266688990109"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.5.0":{"name":"redux-model-ts","version":"0.5.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-mix.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"dependencies":{"axios":"^0.18.0","tslib":"^1.9.3"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-mix/issues"},"homepage":"https://github.com/fwh1990/redux-mix#readme","_id":"redux-model-ts@0.5.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-Q5ecUGELPorVVbjv7ex4VPhUWnZQUaCK9btyaHWqmrZ5WGKQfpa3d1s71xtSiIernrurhCCsDyiAYDtM2qjmMw==","shasum":"e14f6553d6b595456be5bdced1bb2fccf565b184","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.5.0.tgz","fileCount":13,"unpackedSize":25398,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc242mCRA9TVsSAnZWagAAPxgP/RwVqYWf04yQu2oGq/KU\nHoHZgbFB/NCkYRbyTNiuiDj8GsbHzFpsYts5cX85DtWGuNTqxZWly0XNsXAQ\nKtL40sBwes4Mw7s6vkM3S8RUATQS2l/bMMDUYoujGzY9J1/1CaQ+Q1x8lx6P\nWIEuUO3KCJcAR3k8kvQ28DkEkL6VItd5kL+O9kr9/9IPIjZafFPQ04ALnHlG\nxgxCkMg+NzRAe2tyA5OeXV6LxH8M8tEMCU+xrNsv1WB1f8KK7AhEd1DG6jt1\n8zZqQAuHev1+2jo6eRnvC0ntuEhJasVhiyJyhqEpfMQgaGWCu6qZOyY92jaF\nLaUfrDm8q8ZJ4ILQ8qeTHTs4gSfXrsj+sBJST4zocQsjyeSYVxRLBeIy10nf\n4Pn7o0ZvY8Ds1Qrlz2qtWswMHfUnFPxieEE+ZSwhDvQXJTRaDVKgI3zrFqj7\nRqJxZOE59/+HOcLMN+dh3E5yT6wVQ+Guod5tHSJ1JM+BANT5b/dBzAy5kq2t\nMuBJLPtBbnCr+UFoBbozx+uOEUxorGmcKNVGl0nrLYzMEYnyePXi6qUEVABW\n1/Xkh8JlODOVOy7qKDuSLmib0LOtKZjxUik4akuP/On+8JHNz64LOt6Qbn14\nBkTqauXm/TroIfOICF2bdO/S9yYQMDLEmOXFLNBfTMBjkUxVV7Twqv9bPjUo\nwZNO\r\n=bzc5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDW5zgmhhHB3ZQzipDA8x/NDnx5CmUNElyPOhfNfx2DyQIhAJNSszgFIb3cxUHAmAu0xqmxKVqJUEOwG/BSiyrKUMkr"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.5.0_1557892518047_0.8369904820026146"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.5.1":{"name":"redux-model-ts","version":"0.5.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-mix.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"dependencies":{"axios":"^0.18.0","tslib":"^1.9.3"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-mix/issues"},"homepage":"https://github.com/fwh1990/redux-mix#readme","_id":"redux-model-ts@0.5.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-oPsDju9ULE0uvbo11OJdi4sISmAUFGil6PxXvUt3mdp3iH1se+L8mj+jU4OJ5DVTN5NyPBgL/pd6BGt622dDoA==","shasum":"b022c0d79643fdbf857f83700385706d1d0f5917","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.5.1.tgz","fileCount":13,"unpackedSize":25097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc3BgACRA9TVsSAnZWagAAExwP/3+Cc6g2JvqzFrqoAhkV\ncKYfdlfm5nHpEqYBy3L9WmSPKSXTmygUPNRGA460L0qxkGLx0tyNU6rFqb56\njFchrQvx47K5Th9ZmCN/LPmhO6NDI2BFDY8ZJffUx9AQW7nhK991jJkdykWh\nLqjM3W1/6HkRkICQNZ4gwBUss7kLn/UJIqqAw0hKn8ZcKauJSwOQ45+p4w9a\ntvhmamXL+H50Y+gm36fKUPoJ4tznarDXDliCvbwq6BafQQbiHj9EpjH+0e4n\nA3fZbouJVCJGqFUKumpq71HExauXkeiLV05rxaagru0JCWGnAKlixPL9axc0\nFB0klQ1meRL+eli/b4oQlNFKv522/1FBdD7Z9scOICRV40RF2fbOFKLwZAlR\n8c1JMiAAVlQh5zkfMCgdihvKqdtMezQVnSY4mg3TSvbF01LmuwDkzvdl92M6\nmSDWcGsgDbbQ7kIQUGdMJ+N2+OVwAw4uoRVzcdFGLs1ex+iI6lqqZ1itryjR\n8c9SWop4flxsn6lSQx8ysVUAoa5F/1ocmOfYFDvyWyhyw7KM03P/0/LZVj5v\nhq3d2PXHOJR0thSPGznM79Di3UVqZLqBKyG1KT/1lAMnLt6HpTjxLfLoWk84\n+drseragBEFdqbsqprT9E7if+pWTMN0Setyht9hZIwK36Z0R1J2Uj/e/T2As\n+74U\r\n=2+Xv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfGZBNZmZhxIe0cSU6u8Hpj5snbRgt2SUDQwYb0D/ucgIhANEKL5pzuyMJLdiUd5DQBBc5f7RGXke1zD9XnIOO1z5H"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.5.1_1557927936007_0.3519066715274872"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.6.0":{"name":"redux-model-ts","version":"0.6.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"axios":"^0.18.0 || ^0.19.0","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.6.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-0hQeeG2lvrRA8/ccdW+UHYa5iwfWrWzoqoe7AXKxHgZyAvJeCIJAo7KxyUFJ5tUvRTmbM/0OoUQSdcLuVCi7tQ==","shasum":"5e5a6aac0a48684d5c481c6668c923f663775e32","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.6.0.tgz","fileCount":13,"unpackedSize":28828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8I5kCRA9TVsSAnZWagAAWmsP/2UFzWzsu3frlxlbr2XJ\neS6up4XoPiSQNnwwdUZkoM6rWyYs+o7WdWnwN6g9biAe6upzOdQ63Le+w3yK\npuT4SA2E7ccjaqY3Ft0Iy+7Zu1mqRDGQgLGpgD2RXVke/kf5FY37uJWIpc7E\nmiQymnLqw7XEQ4aOCsy+UsRr5DYs6ImQTojrQQnPMVow5nN09X8arlpA1h++\nLOIDXc08WzG0URPhGQd9+5LVoc1b8SpR+Mw33/rJR32ItwU32OqncKNUkwxn\ntXTQx+vmYpOZsNqmIE3m+aowmYgL3kI/EcG51RooCnzHtBjOCdiFBvCgGIF7\nSTgl8GEkxItBA/v1CZ5/+zC8X0R+mfaFt6UZqZ5gTsxjyk6OMrysycRCfYtx\nYXESDozRE/R/1T5DVXN+NmS6OgbgNOEnD7cc1nJFzbJdVULjw93ERKGdYE+a\nuRu1PUsh7Hphn/xn8RafPURyQ9qSCBRKoi1mhWbUem1F0qWP7oJWZJL0UvTX\nFdYmxb/DRKLHfKB20R49u4W+3exfhdGpHqIpuv7oq7V2yhnbkC8zRfIdFaHL\nJQbq9wd4iB6yHnV/J86JTeCiIa+P1rZBGr1YwJd/YoKsqpK3FwRC84ceAc3p\nFAu24xIgE1Yu9hToa3RNipS1Z0i7a8DUtRW0nI7HR0BSVkZSG5P24OrL0du4\nIhTi\r\n=IkbO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuD2/hlUCQ4tFK+JVfxg24BId4J7kAM5GQIvNPFszoPwIhAIeF8rY47F0wMZcxyNwFZVGrQ1/MVCttSvKqL7osIS7H"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.6.0_1559268963313_0.19797633156284444"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.7.0":{"name":"redux-model-ts","version":"0.7.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"axios":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","typescript":"^3.4.5"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.7.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-bm7RDvXGbxMczQajfDuX4HiQj9DAMiblzPPovQMlmCGxLmqFFO8w0c+7Z4kddWlSHoFl2zCcReDelOjhSTDh0A==","shasum":"3a3df7ac2ffd9982bea6bb63924de339e6b962e6","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.7.0.tgz","fileCount":13,"unpackedSize":28993,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8JOTCRA9TVsSAnZWagAA/Q8P/Ah0ah+jeugHs78u+xbA\nBIkHeBj9bgVEq/7XqeMYuoAc4yly8rb93il2tDFXpAVqlwTtGnu8XJ3JN8QJ\n9wjunlLIrVNESD/G4hy04zyr81WLjaE/UIY0ffxyRGkV7Gu3xzoeCaGcBrpT\nP2OZjrXQaFm91KRmOfO5WqMfGzJMqOnMgUDi7mOIU+0Fp/Ya2GoazSEfwXan\nF2U1xqpE5y9+JnTyvAZGASAqdELY/KOAV99Qjlxlj66gfYYjWqY3U2N7NS7c\n9ZiC3l16+54XqzOTwmhV30XFwlM/uPkVidFnrnzVicv9FRlsPlZxI7+DruT1\nPAQ453novlxa6OE6vGPS0bPe52cu+CiVhI7S/jcXlOXjFZsH4wDXclia3PjM\nniMaHKLCFoJB+dEvn+l8fAEIWCj1zCgc2WTNESeHueFBJ5yq78c/4BGRJByE\nExzub0drzGgi7k245hYpwZUCS9kB3fJzaHKdMLTKjd01TgQxVWtT4iHu5SGa\nzZVfs7ZOLfU20faJ0Kh1e6y1I9n497kCSj9LYHgzCyaarrjbTuvZiLVXfAM6\n0M+GouW8Wx0hnu28o6YQqZYO5nvUfRSPO+OgmzqH7VzK9uMwGKyb4cwq8yD8\nP3mxO/gGgbm1/VNMiBOyRb+XHP9ToMaLBG0mODjB5ngGG9gWHZaMI5WFcvdB\n5P1U\r\n=Va0f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIARwLLt8ixsSdI2IdqOOwKHNt1z2KCpuANukZ2HXqjSfAiEAxrhJSwLm/5tmbECyb4EQ/k/mkRH0R/MWnSW8xBe7CxI="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.7.0_1559270290687_0.9652285435822596"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.7.1":{"name":"redux-model-ts","version":"0.7.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"axios":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","axios":"^0.19.0","redux":"^4.0.1","typescript":"^3.4.5"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.7.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-ppR/nYJMlC8bNyqW67m7YKwsMvHCGtKMDs9R1XtitzQ2PqMBFBtdGsV6pPaUGVeuVZcLBzsvkPx3nfsFjw/mug==","shasum":"9382899850b7a7f8941134b443be5e74c90ab060","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.7.1.tgz","fileCount":13,"unpackedSize":29040,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8JZKCRA9TVsSAnZWagAAnNAP/A896siMIk8pIkX8+AHQ\nmDdKIffbJW2GLB5alDecymE4PfiaCjEN2n3HtG2tNj3sDLppUgQQQTzY6TjR\nGisFMZGW/vN4vcyztYLZB1Aeegz37Pt+l+AUeLrXH7dy0L054mLNPMXCPIJf\n1WXA6A4jzK4rWmo84KIhckOXR4G6pJCbetTTdciq3XAng4dECULc8sWktu1h\nZJqU47+EwMyqLB0L2bUrkGRGprUx3zuWpOmz4tZLtBdfU5xoMQHymMGSoadH\ng+XPiRt3F0Xstn+A/ZcTB8JuvUCfZOAsGlgWZ3hEEt5jk2y/M2Xjzf4kAYTu\nLI5Kl+6K2GkLIK5EqhDg8cQLxVMfDsTNTKFY/c0ViyNH7KgqCUt2ctw1ly2Y\nDE8dwxWVsxV0tSNTbaFXRoPfMLbkEFxV1WiUw+qBZ/2zdxCvPNV2K0efA7aX\n0z5VwhSBJLUcx2sJ/Cl5y+7qLStP9B/9nQO5MSb2AvWlMAYMPucZUj2CvskW\nAPQ0m5TH1P7ZEMUJUxOW+fmd7nuRQsVlipbSjBQRfa2y0l5FwXY4xAlpfaSW\n8qqxm3xMwqXcpku8DC4wSRrz9lADB2GEbHouToJC8qwCD46pJgg/h0V6188O\nEHURDwVjaKOv7bVqe24RT6MdYrYQLMSd5i8/kSXJXuCY1kpTB9CWNKsa3hLa\nMeCJ\r\n=d3OA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEcznAIeE+jBOvCOhzMBSaKYbyaI5acFSPYDaJmpjoPiAiBe6yC6cvwLjs7G3s/R+ZohxP1Kca/91eiXmDrXZoh4DA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.7.1_1559270985981_0.7794368360456754"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.7.2":{"name":"redux-model-ts","version":"0.7.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"axios":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","axios":"^0.19.0","redux":"^4.0.1","typescript":"^3.4.5"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.7.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-PK3sbbiY4Z/CHtDOrLPSiVeHiXpkMwVNsHK+RozXTNzRk45qWv8K8OR/rozKpoOmFzkU5+1LmeoMF0cxflKpEg==","shasum":"c017d201236fc9b6e126caada9aee00d43e67f47","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.7.2.tgz","fileCount":13,"unpackedSize":29042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8Jf2CRA9TVsSAnZWagAA81EP/Av/+uXnDCzWjPwEL7xE\n1qIvxz7vOiHqan2VjMVjeAablVsVyYhmq5HRYbE0f1GEXXLGPeA53K5T41u2\nfyXVQtK6I52CSeW5IJCDrhE+4ANy9kO9r9XkGpISkeQ02eX5xaVr9tofehfZ\nIDGfE0NaCkw8LgKx3nwfk2C51SRTRfEd7E7B/M55xbzErkwWdWrNTdCAFKg7\nRmS6YfIXOIJGoMusNu/rVACKg8DyvF6nFrLGORrZ7q8zhyfkHkFWDLN/mmuU\n8bhURUpAQk9GjGTOCMNxeKxpXcCgG9ymN0ENDXqfa+jQIN1yXfUW8ASyQ6M3\n5xEXMa3ZLTbpKoD3GOUo0oM0uB7I+qzqrb6E/FiqZjmMe946+47pSLvqI49z\n6QmO9fPuIhly3BXzJJtSMKxPpuIJ5Xy0rtqzZnHi6ZhCk8zlgiL81smI48YZ\nwDMWpuQrg6xj9i7HDM/dzwW4jIp4Q03aWiDDlgHidzuadxDVI/WZjNVYMJJa\n5buApZsPhTDgKd1vAOaHZ/+zW48HJYb2wHzhkeys16GXVuCqOBKncG8QTzDB\nmml98BCH7KuJGexoAtk0iUaBMK8jgtMi2g9ncR8AJDuJgPY+ns3QH0Z9WmJR\nUNh60Qk/osEkg76GV5hpryIlk7CekjhoGTIPXDAfh8DsbDHWrT1RdzI2lSTh\n0ibI\r\n=hyzt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8/dX60+4XzEqrID6To3t7XENf1loPeT8hra3F5QtB0gIgLppdDr9NR5OFt0HSi9JiF+//NvR00YBOCLlvUzSRavg="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.7.2_1559271414227_0.4627059191261751"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.7.4":{"name":"redux-model-ts","version":"0.7.4","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"axios":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","axios":"^0.19.0","redux":"^4.0.1","typescript":"^3.4.5"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.7.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-8WCBWWeSAqvyBJccmY5TVbMCrB1emQQjPmHBM5UihyAva3RU1JQ3UcCN3a/ZyP7oxRQHqcBeNjBwvzB00JNCpQ==","shasum":"72ffcfd31a9171d41810aa7e602f8035fd09a4e6","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.7.4.tgz","fileCount":13,"unpackedSize":29001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8JynCRA9TVsSAnZWagAA82sP/3ZfPr36iHixd9bu4kXN\nwO6VSL6wgqUju7G/8IKhsnQgTVAQtpZQSiMTmYS1/JyPerSE+AYvZNRaQscH\n+VZrGf8GlZBQgNL+Q8u/NTdpWwigNQwwX/9Nqf6KmMlnYd1hCRDWGx7+q9Cs\nhXLT82ZFG33UgAbGD3FrjVuNHLf50EuFWOs3BVLptfPmOvOvvYzIm2NddjOp\nfuvBNyPs5yLdnKEovTZkzxJ/Pc7JnCu6i7Di8xMYPB8cxEV7hCOao8Sen814\nRp/EeP0Awq0sRdR98u+mWdVt5Y7OWyM3yKjQrwiPBGQQacluVw6eXvzdfb0B\ni6+KFzeE/MabRgEn/aSG270xWVyrTGFCSJa96XAyTZ1nClUGzwkIRDkJi5g5\np2rrXR+Hi0Bkri6x7ROyVUW2VjOSCZ3DkXE4Uv5MiBSu86H1uXTpM4Q7XVxD\n7YrpAvUMd42tho8U67dKNYmxLFYD32j9Yh1fpoEXYCuS84VNaF0EkdNBHlbo\nie4EC2fZZzYOZYbMkl0Ba/mDQOvrfhmoQFiJ2g6Wpi6znqXFzmZuUB1I4ws6\nRve4kuO+7c0PEThw6HpYrrEatkuO4KecUU8lAXkXfXroFnCgwEBR3GEFKb7R\n/FdDjdpCRUQNZA82BguCeJFWGAN1CuppEfwPTDWzX3YTVqp+DMetfwNlC/lT\nR5LZ\r\n=6uIt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXJ0a5G5E7BH8xvrXILzboRrJgRrZFHsXkq05ZFKMVNAiAYWi2JL/XnRjkqNA6x7zi4FnJe5fJ7MG+iJ5MFK7TSgw=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.7.4_1559272614969_0.22048907527750194"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.8.0":{"name":"redux-model-ts","version":"0.8.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","redux":"^4.0.1","typescript":"^3.4.5"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.8.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-pK6XMgF4yqpNz0ccV26W9cLDVCrWE7Z4rpk33rzj9oe/Uep86Jm2mdHj1C0BRXcarr28rszcJ2sxJF0+8x4kQg==","shasum":"f01b2e82bb6ee36d216ada9575b4783387674a6a","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.8.0.tgz","fileCount":13,"unpackedSize":29007,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8J5sCRA9TVsSAnZWagAA6i8P/08SQAMjKIrN9w/Hjm/j\n6EqNGM8l65wSMQkd8S+XXTsN8SzwDUa3qhf0Yv8u7hNvR7Cll2WAdKWUCGoV\ndN8Gl7STKbzsVGrDIlnaAO5KD0xmuOQNdJzPUeBXXxIo4XP5YSe+B1NRV+Qe\nNFLQRedcv5zQNTIrGKapzlTjOHXWXtOw+03Xq8F6zS5qcVqy8sSJv3N9yf6V\n42Tbt+hCc33Pbp9xTlyPpV15CXMBWlF3KjLRf+hS2YEEwNkLm/SYpZpjrhBg\nPJ4y7Ab9bgG4U5DEkFMNEA9Y2BazsfSRHZPgsA9tsh0ntokFeXvEfM6eiekn\nwr0YyTR8K1+1r010wGYfKlMfwvqaYfV7AEQjVsVqIAZKN2LqYxAGI5I5qXfz\nsmgV/hjyQ1QW5EFzl+vuyj3QOOL0Cmt1FsiVKIUqxKhmca+Cf2dXy0ioc2Hs\n/iF/+E3RbSeB9MjZ21R/9Edb6TjmvWveti17iksaok8hy64pbZJYD8l4tybs\nSOyYtrFW2AXiySbL7XQVnk4MO3ab12xQri6M7TYrUbLLCl/qFLMbXMDmSttO\nry117ZjdLdNRvXYlql/IVKzMIYvk+WEMOoy/ta9ZDGjKH13PAs5CNcvLoZTf\nuMvZvX5CSxuFRSuLntIGMs5EGY0B9Kiq6GnM47ajugdedxJsYEfZIfNgANdT\nxs7b\r\n=4Vs8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhZBEOtHuhXhAArMNNdty7bbenVOgZtWh3Np1aAysJEQIhALLtrKQpA6C/FtIb496q6ImWfwtv9pS9uGC/LdHI0JfR"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.8.0_1559273067852_0.5136845756535049"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.8.1":{"name":"redux-model-ts","version":"0.8.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","redux":"^4.0.1","typescript":"^3.4.5"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.8.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-+OfUE2VgfEKe1BcQ0TRHPoTWuYmX46/KCqTSOhZTj+w2wES0NqE8GmLV52w8WiNnuwmHD4tPmsNyiZQNuocbNw==","shasum":"194a19c5c3d4f1059d515edd78ab47a8a694f22a","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.8.1.tgz","fileCount":13,"unpackedSize":29046,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8KELCRA9TVsSAnZWagAAaQsP/jsYD/Qq7DtpVx0H4HqH\nwtCteeVfn0KkYycIgX4JJ/TStAquOrB+61SFwGS5629/K7PXppUdsT45Dl2U\ntc9XfGcnADIkI/FI31FuH4K2Ry1nhvUYPbNL6/KhfqdFWBrzTArwrAj/msMn\nbpjeKEspORwrp0OjvacbmsNlIOcTeHccDyQAesrIC9zDTBdMC9LE+6X73/6P\nKtPMVcuJDDZNxTBlueyqRaUqWEvzYTlVKAOjddbJ60txg3tDRycTYejoqRxR\n4pnoohyCDAvpsaMgDjRSw1YCIrLwPEbEWVusov9pgqoRQ210LhKZZvGJ1AhD\nof4wV/TJ9+CXq6N7QVa0RzafnG2iEAZ4etccOZL0ojFjz2f4pnLY0sRkIwjd\n5fSSQkw4PPbZH7LQ0H7lAM7br2cZXPosUNiiZd0OTHh5FxRcjCSgd4Ojywvo\nSjAYdEkiLihBehhC5zGOQSEtngLbOdQcxQrQQR5n84m7qd774W7niNS2Nuqa\nOv13n4w0QOKnfI25NijhYmmcZr6NlXlITyAe+jIuiZXYeYHM1bE17lXXMlFE\nvXkETOD8RkPcmt5X7687aeuoKo4P/tjztV9mX9YQq1yZ1iw6zZlT5iTvGokM\n3SUZmcp6+vnR3CHsk5RtkDHxZ+j7bi5OYvLqbd+zzyGLdftjGqToFLru/hhQ\nYA+C\r\n=cqi/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDye+FWdsDM4Eszq7pwF72TNqj2Yt37OrfCtJxkmsqhfQIhAL3DP8RJ4nK79SiUyA7xNweiRmI97ydfDEdOmFiH34/E"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.8.1_1559273739278_0.07249182445702607"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"0.8.2":{"name":"redux-model-ts","version":"0.8.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/webpack-env":"^1.13.9","redux":"^4.0.1","typescript":"^3.4.5"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@0.8.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-qvWAFcCBCR+NLghe87y939m2bGznb1zo00/p077CmZrY2lEKt6f8a0spzOe69Bv80S5z0qv7g/KngSrPDFc9RQ==","shasum":"3fb37a02732db54b04973d5a27817be19a7ba814","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-0.8.2.tgz","fileCount":13,"unpackedSize":38033,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdC0TuCRA9TVsSAnZWagAA6FIP/2kBF4QXyx4MdKkIIFqr\nPgqwtUtIBuWqYaLbB+XlXcUE/+m7W0kD8EuiJEAu4pX4mdBPHzM/9Cu3ihAP\nqnB7fupD8qnoc1/v9FEbOAdYr0af4B3uNtxhfejgM0y5B3zcug5aNqfnr3/V\n5oEHl9mp0iMRtjfUjTjpaMvIvFj/oy5RRD1eAuzNULfKDbMYj3K2EoONckZJ\nDxLipXr3vxQef4p3RQmcZLgUN4zVAPRcm6WIjGH8x/EWtNGka/bE78vV1yin\ndN8C/76iLq0LgQy0HblshHsJlYuBvOZwQ+Lp05ejdqGZnmMSlleuMaaIcfFf\nNQSz8UV6ZyBsYJuy8Untl8G4bbewgCJsxhxHgs/sYyzcIPTdAE5DI+QJgZ15\n82WgJsv6l5l/ER38+XGtUIZFnpM4FW+4FX+IFv1O4ep1FrVAIASC2hg3uCaz\npjA/Mx/V8RT9rwxzgQ0+QnIRU4Dx6UnH1FCxOY5a9OKyI/tVJbbuguiwpkmO\nPvnmyViIuEykOisxBwxejbB9rUmouDp69ti/ShHsyRCxkAldBq7FBQ4f2+zf\naC/rWetrC2t8SEYFKie1YDswinAJ9JsYy/WQ4d87XYoTZzi8WOl0gjm9jFsT\ntl4RK/Fek01qqaz4gyQMlxKUZgROsiPOAssY+qy66AkdEDi+bouOG76Tqwth\n6EwQ\r\n=t//N\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDa0RGDHM2Mltbw1+DveAO0abLmgGoJiLSJsGLJdRhY2QIhAPJpjmiZj1G7OHjvgZPlRwdwybn0IZSnesXNOWLY/go/"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_0.8.2_1561019630143_0.9048513260651776"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.0.0":{"name":"redux-model-ts","version":"1.0.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-4h98y92cj+oACIYtpsp5l6XZCJlF61DkCKmBRbAvfVoGtSpJuknBEoNHDi2/sdx3e0U/WhyCnjtTNlxOxTqX+A==","shasum":"829c8842800f9b8630f1c26034c83a7030ff058f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.0.0.tgz","fileCount":21,"unpackedSize":47825,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEw76CRA9TVsSAnZWagAA/R8P/3SRhicjGVll/s2ctfX1\nN9qtdIH4CmbAhuuEu5XozQ48uR/Is75wM+QVipZIvbA1s5lUZ2EpZexwRpvS\n6Cv9Bto9zSE4HVf670HpmbNmYQKHz+Lp49W8nCrNLdMXS0KdHKb0mMu85di+\nl2VR7AfvmRG80+NjsYI1qQ8XEqrtBx5etVreB/8qs84OvwqzZ8eWx6bQ82DB\nxIPpEnRXg88j0MXyx/ZVGowcr5JrqPubz4UYvTKrlfKWGnP2HpzfAhZ16oqg\nbhXT+rvOEftOqDGkb33Lv3AfU0El/2d/LfGY0QNyxc9Rq2fzB543affHmVhG\ndZY7BfNpQtBApYctU3HKbwTaQSh+EhaATSXoFNp3GuQT49zyfhxjniFbgh6C\nRA1VfS9pF6B+FFNhGT78n7sIwOtaAMoSCIS7+HQaPNQiYXrGCsHQBGkEDwFf\nJ9JehVtMkYg938ETYpjpm6gVHJ171NHBLl+BrEzdPn6XIAkMJwEReyIhlIOk\nOKl0Xgx05RbMJP2nzHcG3TUebgj3APiHCkcfHUHSmD54vhqZNpukzqkN3W2J\nneOffGaLG2wd8VmihL+4X2d8U6RTd3b1HTGXJnN7HgUcXjjbcmL+Ny+gpInb\nxm2nSKNVAhOFh0ccxXDxWVLwQlYsxoBQdW9kjhG1IQtQBbQTUn6nPd4DhjLQ\nacTz\r\n=cpGI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAFvI97vRWm8EemTm7mvb8n8N+bSRpY+EhMURFH2ll+mAiEAynCNa0prVbRcdUrNnZ9gI3RXsUgnN4qiGtxzEfY3PUg="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.0.0_1561530105934_0.9659640943007115"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.0.1":{"name":"redux-model-ts","version":"1.0.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-bHiIK5L8WOo0oNAsll94e73qBPB5x/vW5coRmP5aCgsX9k2ywMmSUPwC2e82jxHhbc4mfLr4L+3gHclt1605Ag==","shasum":"94f7071c682fde71a6fe6750de6d9c855b76b7d1","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.0.1.tgz","fileCount":13,"unpackedSize":42065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdExH4CRA9TVsSAnZWagAA6GUP/0wGWoVuiqPG8sJvtHVM\n4772o+GSLyVo9HLUJ/BJOKWc3j0NMzdzMvk26M1UmkMweyj1eJgsZ0KJKDNY\n73sw8eF4kI8uzeorTfxLDyfbe1lY16DlWNiYBerE6vBae3ymkRJ4UMqQTheJ\nme8cVzC/KXOlNnQdR04Odylglm/4QXbEGHsQVHxxQTARzoQnEkRy939LHBNg\nuCW97rzVt+8PD1PZxvapuPW9mKXTdqcdclFbTdDDhNSXH8cuD8vZ0KBC/MOF\nkB8ZLOpSJP4GsV7RVtTPyZKoSRHqsvUKjiuEcD5+okWLbAYJuIIpqnalTnBu\n+TVMPKMAMTTeYURr4qlpulHQZDZQrB6jCny+YxYrIevmTzrfMwNTroZNujMj\nBgCXa1OhQvBlq8pJXER+A223Jq4lmw6hR/Dra7WFb0hrw82L/RIX60Hs6Cy9\nEQjZdfNOOxw+f6iYToB/PUUEvPLAuQleakgwVR2HL1/b2IFr81j5PW0CuZTd\n17kwbCS4Q0d/fp+wNfavlUWeSsqE7EET3vy4TqaaUa8YeSaPb/hqDadRbAbu\nspbDDFvrwKXKbPmn1E6EiFxs4X9IRPSYtQZVCY5bluUebWlnrrYo3VvgtbDm\ngSroR2f2wp2lbXGcSKTcn647E/sXscaPUHtVFr0mM+OqT8IYlfdLG21QB6Fo\nnwSX\r\n=O4UN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBJX9R4n1qkZeOdRVtwO6SZZ0DOu1lsMv1yDQwQ0507nAiBlL0FumPtoWJHFK+lMvRGseaqcnEEhnkNRHlJPn07atg=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.0.1_1561530871912_0.07301620622853577"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.0.2":{"name":"redux-model-ts","version":"1.0.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-JLHt5aXHvHh8w0l5G0UPKYpNR2E7Nc8sNCUdgNLeDtryfK9jgDRREFWF4AVZdRXwLDu5fob+UBWeL2mpIWparQ==","shasum":"505181cbce193f39a207f829156ab7d20003f621","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.0.2.tgz","fileCount":13,"unpackedSize":42066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdExLECRA9TVsSAnZWagAAGMYP+wQjdKy3DpvToy+HormB\nq5utMlPC3jLjmb1gcEzRS5YHbWyOPXoe61PC7I4FHIBBsQE8cqlU3gvQINKY\nzUsNo6NOZSzJKV+xy7vm/Zw70Zsuc/Gi/CLsij3yGiSFlBR2U1oTHy3PR3Wh\nY3D7gRulEinmm3IMUBR5IjjLScNjaradBiYf6W58QP6JJ8w/NRTpdT+xlp1Y\nW2gdfRLYmM9qWnFPrFE2Gq5QcWGxmhHTrfZOhSkh446Gs1nohuRe++gG7+xy\nGPMo722gZfKrp+7YRfhRfS60Q16V1GdPYaXdzNdSmvFu9DOccBy0ZYgsqSMy\nthV2zWhNZ9G3Paoym4IUrO4dCuu7TSstx3x/4o3SgTskPGqgnwjmTOlWvh4T\npp9Yw/s4cyu3w1s54o779F0ImsTfrVDGCb7vO4/ExvCKXdWCBJn8pWViND8a\nBGpr79CP8vsx2yH2toPwrp2VnYyL8Re/Dim1LzdzlKUaOm47Pr7iDdRLJjXF\njV4vE+Go5TjYeFf1YKQV+OA07fD2xMdKh/ZD6GkpaTTh9jr8jyaL4SLgXkGt\nioyGGALDo1e02tmZoLQZgJFoEuXFu6mTrWxlvUAKxQlBZ4wMFzlJtu+T5C52\nyS0I89VR175OuzAldxMF1kPrdagqlBJ8atgIH/lBn4214t8f7lSiXWC2X2u4\n8k4l\r\n=sNdk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICb9PRIdv3qUPI4ksTg3XbyExauojL6yl7QT+CXwuLcpAiBm5f5eCI+z6WJvoFpYeFyt/Wem+IOmS4m+DwI6983zkA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.0.2_1561531075384_0.4232340970815125"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.0.3":{"name":"redux-model-ts","version":"1.0.3","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.0.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-4A5yBZlcCECHyRAGrRVf4+TBdug9apvjL8UZheN8EWH0xJHTnBbqnQJerHM5F0l96G5vkLEY77jmfMwK8HeUaw==","shasum":"79862011af755b65f75544a245b843c8379cf6d2","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.0.3.tgz","fileCount":13,"unpackedSize":42068,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdEyEBCRA9TVsSAnZWagAAOMAP/iLWa1fWaRy84TlvBYYG\nALpIwE2nd8ifLc/FzHVc0w1DZptiHSxlb1QRgIMk8T4UGMhsvlzdfbgR5R1q\nkSoWi8uhIFtURrRGRLO4KR+JOsRrNQGQVw0Y4jh0jGOgDmmLT+AbDqIPL/QZ\nshq4LzAkM3kgJE38DJTKdXAhH9ZIThKNUS5f/i8fatTQm+l0yMoObt8S+S+b\nhfStyP9HQDp15se8wgPx/1WG/3ADKjaxQ5ddNmsLxKcYFUfh3KOHYkO2xiJC\nXywMHb0mPIkKshWyIbtSuXxIUjtww0vVIF6ZTeC8uFhEU7JyC9NBD/YCC03m\nrS6IgYIguzqvP5u8z9jriRH1uW22oi7/dcUYgLHJKfXljeuNph8DvoGrpYKN\noR2NXGBk40HuwbiqfqEMK6eqaOTzgIXZ0V1FSespi5lA7AWMg2aZBapbV+/C\n9hh6ASHAKesIk15DCtwPh501sywnEPxwH4kEy/TnCQO8jWSZsvtOJoByWs8X\nLlcUjeaUg2JeoJZwlaqwBTJHcWZp01L4tikgoi4PAyPyqqAtrqA6CmBtcdYX\nW3aAhSj42qN5L+AYCk0YDy/uLxpSbamudE/H6RFi2YdICxtXZMcyVaReUv2G\nkk1/kgkFr6zE+srEWg0FfGPLyAVo5uLus3/reLpb7P/jRbo8WOGIZ9I7qI2J\nXK2X\r\n=LsI3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGvme1KhdEF7QrtEYLwkmfejCgE4kWrm9b6WfT8eP8pAiACLtZwmjL9giYvKPTcxIXk9b+qEJf2HOvr94XZtTPa1A=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.0.3_1561534721177_0.9768138409173075"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.1.0":{"name":"redux-model-ts","version":"1.1.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-1OWcath2MZflhIDP7+hf206BcN+dbFGsd6zxC+qhrtf+6TULJdaB33bs5MGXytN+qzF2Kafw6XN6p5KlaCnY1A==","shasum":"8bf78f750f9e2a2a76ee69b0dc6417e00680a64d","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.1.0.tgz","fileCount":13,"unpackedSize":42198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE0rkCRA9TVsSAnZWagAAbB8P/RirYrnx0IKQphiSim06\ng+5nYP1rwLMGFMdMYDfvktxc1y2XG+wF1/nYNhmg1bdIzcyk6ZLe8M+1nZ90\niixPVDtcjpuTQJvMyV+1p1+tuFxKaN5htjcIjs7TaXXyzSJIwlAruIxbCimU\n1npXJW20gY4DSkgS+cf1v4RO20gQvk+GvZiy24N4hjgPhZsbdeDApgiPiN1g\nBXoDPRMVl34MYNa+6bYeFA61wDP9DGTF3GnGpBjvrME1kPmwJ8hVp04FH0CM\njcC8DryaTWstqDz9B15pCV0W6XWA+WnbCc/E9EhIuotmp4cLoFL0uj41/Peu\nRvw0+rxyb6rCZ9S1J+9jTcQ5cDqS7+jv5eNCYyr1qlxHJ29K5KLh7lSQ9Ny/\nHIMrCsSxGayZVZMSWjvTVobmVtJk9D2fi4Ee2DG/GXhbflix0u0grMhE+97f\nMlBseLtpSzkw21XVVkt6JLA3AOXrko2Tsq6n49sDlX+38HWQCOPsu9eOkbLQ\n490t07ecSIVXkTXH6YeB/wsblLXOk+Ii/bzXJTDP1THeqX0Jj6/eVyAodzcn\n1S6lIorJunI2w9aY02u37pvbdIgHIAn/3EFjTaG2HVUXOCZP5ZnLpGeSwEiI\ni019TrVoaSTtSTsX0IHyGhOZeCyyMYSTdYrxVj51qnPYx3BUyMqf3EDUnjm8\nhxa6\r\n=sRpU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrsbQtnzWCtkQuqwxnRNsfE1NCvNn7zcYKz8l2ZMYAUQIhAIwEhW4Ifr91oFPTjyZnS2A59SQ/UegKpVPyDI7Dyl3M"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.1.0_1561545443830_0.8102282743121623"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.1.1":{"name":"redux-model-ts","version":"1.1.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-UN6G1TuNKwIP8fuuZo6NHaZA4AFeZyPi8zflYLSIAkP8b2VQsfnU4tqiGBIp/hqRQIuv9e3xfE6kR1S7LyDNVw==","shasum":"9a9654a4f4eaf99c3805405066604e94dc31476c","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.1.1.tgz","fileCount":13,"unpackedSize":42198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE0y1CRA9TVsSAnZWagAAsy0P/1eqVqJzibBmj/O1yXmg\nEJQaHg4mqW0ymNm7wVPSxVqYDBALOyIjaWmvvXVef16BiELuUt32g7kFcL8I\ndgrdut9/9LgkHxaodwX2G1gDH1uiB7n/jthVrTQF7F6N2zmL9cYCq5m5C1tR\nIYUzHoeunh+DjnfnAwdZTFEP9vR4BmWrgEaA8z/VZwdq6pVHe19hwX+vY0q8\nRqg0Hdha/3/9I2kQEEJ4Z+lxq+a3x4F5kB3Cl4A2QQk7o8ZBtEkbafqZxmIM\naa2prvawHbBWolikzZEiLV0zkvHvwYLSvYn0bwSft4I4CU+URsDMH/u/GDYI\nDk48Vn5qPlK5VRgyu4B6iIA7JNYAO5vsJaHkrfcJkPeD3c4gP4qKFKAgED+w\nRK07NG7a3ZVGJB9WxA8hx+yTHdf7lS69ib66hTMQfE2/oPDXkSmKDf8K0ecS\ndmsyqNM+PObAUkSI/cHnmNCX/RRms15Lyhz6YkNkLyi3/l/MIBz1nThF5UXc\nSsoRU7zyYik+L3TZDxRGTWdG4iD+4LZ14umWUHEFG1MHUE9Fx0W3iUxQVjQz\npr/09YuO9Djzzmw++7CXIsaYwip2Q9vfQzTELs11sTYHiS84hMaR0jlyNbCS\nSRZslkQHKAra1rbeYkt9TgLCvCcAwDqF8wDuvYTZ99fwBNnhhUAG9KlGBuNa\nWMsv\r\n=KE7d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEi0eCw6M5R6u2iRe3oy9D/7gTGypGxY0QS5PFn1Ob14AiBOW47qekv8Qz8olfMTHjP0OqbBod0fVjvRyxT1b5X9+Q=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.1.1_1561545909175_0.4636756167001772"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.1.2":{"name":"redux-model-ts","version":"1.1.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-RRYUTVcplZcXflfX57nvRvrfqaQNzq7mHaj+/s1U14zBabYP2V5lglkiUhnGKX+FsrJaZ3mJCyEelpF0KP8BRg==","shasum":"a0d18209ae8c54e23527f568f8b580e24d3b6fe9","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.1.2.tgz","fileCount":13,"unpackedSize":42112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE031CRA9TVsSAnZWagAAAJAP+wQSDTmrZI8DjhtCAVaD\nJOOdsILFtOQTlvHyy1HFZYPiXzeskeb+eUmIad3pvBje+HhCZ839dSQVq7Dn\ninMkKTngU63hKvi3x7aeOOcyVnmwIQ409E4ywVSzxT7gm3tk9kRV2MyEODlD\neT6LHqzqss4gyEFbo2dAH5Bu7h2GKVKF2HjqAphDmhIuNnBxsWopT+hXgvc0\niPIkzENX22uT2tBgzIExxQmZtGM7eat9/G29vlSF7pUBXweluBgOOtFOr23O\nOEItHwKQ56yuMkA6lJ7BSwjLJt7FumVQVn7JBRustjcJzlZvftGzITQ7DxN/\nYlIgkWznb3GEDhN8gLYk4SPuEXm4QzHgbfVI8BwyA/mBDt3UEw15uWITZCBP\n6DTFj9P3yEv4tA9fe7XqCo+/UlOzzgeNE3fkhbR+aaxnMkPv32/aZ2rtmooV\naYbZKic4XhLev4axpYD8LkeyLWi6wAEuow7kYl3f2euB218VM2b2WkN0Wsz6\nHtkcpbIttkS14WCXnvoaS0/l9NjEOlZ/TDGs9j3VEMBSBFi3ufBr0MylifX1\n9advbuqcds2GKXAXfQ7e/Xi1F1ZtwyXLHjNpK6bIkPcjFZn9JZje+qe/JmNH\n5xcKg76A+i1Sk8GHirRHbH1JI6wj+DrSWsOuwuzVS6NDUHceE96RTb8FmHUI\nCH5/\r\n=HL4R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDVLjXPK6cPjMmZwYr+tNabLwv7EDC27WV2JK6zLAwi8QIgLq3IIKQ8U1R5FlPTHBBd7BrDutKAeX8iiG5zG5G67uU="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.1.2_1561546229348_0.11132403947463865"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.2.0":{"name":"redux-model-ts","version":"1.2.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-YLCxxsmbUvyGKyV2g/5oq+M1mRWawcb1XA8CXH6s0Ysan54wMFNBaG+fJy8/DuAe+cLksUGDpqjVrQyVj5ERmg==","shasum":"49ae84bf6867abdf02f16e2660f0054c927bebf0","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.2.0.tgz","fileCount":13,"unpackedSize":41768,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE47DCRA9TVsSAnZWagAAQLoP/3UoikvvXQxlc2fyZFAy\nh/134664hi0jb9usXG+S/QGDLlpVuttTUqkzpIpeXG/YznytOESFg1XK881E\nU2N5AsIVXOuDbL0LEsbsepLPuwTAJxXmO6QO5ipL99LXo+w7T592AnumtSE1\nxjK+y0TtVvFZAhnT23Vq1cGMXVWgMltZQspwUVzeicshOc5PI4pX9rAxEpo2\n1+/+CIYi4swEF1ofZWuSLHG77TixXVNtIdHzNTgNzAU+ZYt/etUpCTIHfaCs\nOOsYlADkea/u6xqbn1vLPRen0X7caF8ia7GtRdFq3O1N8IcwOL8iKay4FFHe\nGFw+Rehg5S8Nst/zdTgNVYbhAIRygbOiOwjSeGCuTy+cIw/RgIoXYxdlk7uI\n2xosaa4R9JJGH6LrjqsccSM2sv8XJEk+9uuw2fRH1pE7WY50I/VDeKxW4gRf\nAQrKJpJMIBC0DCHqWS2C0JzqAreLZaHVnPiRuDZVUQ/dkmpHr7/JOWixHoz4\ndmF7EoIFuRWmbE3rklZEO0ucfgVI5YYp+U/AAY/9wkzYxuX5fnTdp5xahC3M\nlm7F1CwAcjV1cBwSaUD57mSoiDmZfoYcYVuu2gH5VujzdMZbmWeOJ0fV26Ap\nEx5MzARKyKt/x2FzuxishUSIQvsxgiQecnnqUKW5+93baMqUJijmx3J8ANqz\ncPNp\r\n=cw8F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKPKOeP333jYkApvfBYs9KHqOkSK54YW2NOK2WM4ZEVAIhAN8zz+S1mPfXo+OwgcBB+wknjG1VzLMX49O84291JtPV"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.2.0_1561562817199_0.7206444155171621"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.2.1":{"name":"redux-model-ts","version":"1.2.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.2.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-BTIaHPlLSVAW43EtieJhbi/nVy6xPf0LJxYi+k6EJvKVyNzHAWsPJTzLtWuOxAKPmCr8RlWLLGvYElR3g+j2fA==","shasum":"7f854903b3fe507e4b55d3ad7217ea59b496b9ca","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.2.1.tgz","fileCount":13,"unpackedSize":41461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE5AICRA9TVsSAnZWagAAcasP/R1dVfnLLefUdoWW6WpI\nxx3mD20v1p+p0/KT8MCshKUUAvSuqgiWZxxdYwciu4yqPd9vwqDRz5sCxDam\nqubRMcni8fq9FUCDaYLLflHujhUlZ1Lyslq/r+nPjsFvhjN9FCfLCc0rq1aN\nX+Bh1otY+zCft5Vtm5BtWeHbz/53rm6pt/xE41DcoZW/VLLx0ivwFF6vw3w5\nlzmuyNSCDOhgzH8JOEY3JEt6WuOylvcOAov80pb5xaIdod5xkt3+vwC8unZr\nsysC+5A0YixmmRWfD+oKQBtIr41lAwqa/8E5HtYOZuXd776+aWOa1htJwfMO\n5WimXk50u2Up/HPnnwiCSzmssHdjp/K6ibHr99auIRtxViZLjwPCAR7cBDdL\nm1xHKOaIAOLyVYM3WoRE7E2lFunSWkTs2tdpyUqyyV7IfhVIdiPBta75QRk/\nyeR7lGjPdGIFIfjw0ttPg1DEC7c/HohB0VtDY2kBumCIhc57SbztWn+tC3Mz\nMGio23nh/g+DJ5YiVE1u6nzzZ/jO38P28kIOHEWUdrGBNLs7tNnjFE+Llse/\n7wK56lDMyzBiTtmURmEf5jkC8glGkfeUC5TBPjHYSd8k7Jj2KLvWnLY8q8tJ\nYZF8X1jMNM6nSkGM+PckwBEjA6LwZpzm6gz94cYD2gEg8zwfspU56MY/pkEh\n+Hpo\r\n=VbhM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID1k4ADOpwA6j3G7K0oUj6aDVl6WaAGu1GPWVzxMXsOCAiBU65SHiMei8nOqYOLIhjMjBfGIObQ33dakgsC0++jApA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.2.1_1561563143768_0.15779537323796844"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.2.2":{"name":"redux-model-ts","version":"1.2.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.2.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-nb+6EvRVcuw4gPV9iKVu9z/tKhMmq8rVH0rGUkLm/+zwSN2uU66S32ti6bRLxX1ezxq9jJxhElTB4zjjKWBi9w==","shasum":"5f87ba008b8c8d8789fce63ffc911c48b3f00837","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.2.2.tgz","fileCount":13,"unpackedSize":41719,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE5sUCRA9TVsSAnZWagAAdwoP/R10mk+gUDtL+gpTz0GO\nLSDVXILSr7qlN3zXU2HcHAYIxtY8lwv2wyWHtN21xPC4uNb9trVtduxaGNMi\nmu2ZBkBRP0ektDrM3R+80og5qwCjFxNHxZXcxNFZNQ1gAvIP2X5OirdhCbFz\nygSDneI2qVR8bFcc/jDlsheFj/YHlL6DVelWyhjLD7pOufAEzHhEsemZlxVx\ndmhfeH9MkrmyponLbe0iJ/WJ7bMqFWjoJ4E1rEwA9Zj7f9cA7hbKCG1GBdl8\nO8HLuLkNLvKgl46bkPD1jF3XNNKA5KdyrGy8vOABB6Iz+j3wte/o/0leIBbg\nWurwRHXX40AqUPNtgLs+qTK9HgS35uOxMmemzJrrPeG1wzjOHgs8Hv4LuWIE\nYJX3hlV2PUkb2Tr1a0LukLWSPZ+GSiBlqj5E0MORJ7bx8fMbzPF7b0LX92pP\nQhTcACu9/Ejyyahd+gRvXBxedG4KR1GuEuq9pt3lrWwiSTLDRVJ63uLVlI4L\nQhvAYIn52TJ3o7H9i1UtkuGxDeKmidYBGEjSI6BAtVVImIQ9+MKDXCrgeWf/\nRuNjdSUFPwsS2cp8GAfhQoB7rQ9ZXzRTTU4ohGyt17HkPrDEMB4aKRb8iueU\nNNldj9wOXJpsHqn7ck97Vvz4wXdsIeJUk1ijLM+X2HSZX3VK801AMAQCmMRo\nFwL7\r\n=sAXr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDHyIOEfhwxt+Nya3wLb15VYDIT39TKooXLdDWenlliMQIhAOSAyzsaL+DOgVjfi9uv+EA0M/JypCYTSUJyiWSZZLh4"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.2.2_1561565971805_0.044002185439619756"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.2.3":{"name":"redux-model-ts","version":"1.2.3","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.2.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-RCbAJ7Q3pKXZ+hHeMxUXfxh+O+KinvLs3AP/6z4UsoxlxBDbvP6VMMWqmMEibllcr1ygFGZrmWtlzGRMT+LOaw==","shasum":"7f0fd1018079f4bf322a256ecb47e8d8ffb2b631","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.2.3.tgz","fileCount":13,"unpackedSize":41754,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE53eCRA9TVsSAnZWagAA83AP/jGBSIEaPWFwrhcx/sb1\nOLD6BtlEHl/4YC5e8SG5iA1liOCxGm7TguKgGP8DRgVLEIX6wisrJI3ypZ7d\ntT6AgPtOkqikPOMnKz1i2k2zeaPV7CByNreZqiVZzEB0lx1ghixex96RwX58\ncBwZhXdI6AMnlSOnq5mBKC7SF0QZXHexWRlKh3eUGD9qFZPjWnFwz6NTijLu\nCYDk4orcuhc/VRHzWtZEkS4YDwvfjxPPIfmaXpwlzh4ZT6UrzE4HfD4XRtx1\nk55jhTR3kowIhrT+/FznAHLXtH4ChCostk7X3WOjyntZvQWbOG6gegid1UfU\ntvTPFXzno5XCfgW6BRkGE1fGTeFuWJpnzqPt5YFwEsOFRIy1rjXFkphTeZiy\nH0Purr3vlBlOOOL2MtH9ZNDpePN3AtfWZ/dUWtoIIFYsP2g40CJ+P72F5A/2\noqHTTbWhqyDpWxVv43MRGQQoDnS3/Hw8/HE249U8Di/pQE6KmN4+blHcHJxR\naBv+pfqPNA6t64rTKk9q9ptDQ9yxtQ18o8cap8xkBuKTW5zdWR2zGb6JxUi3\nJsIHabNv21XGuVEfacq6Ye1XMB8u7s3FjKdT037gA0CYOof715rKyok09c9W\nD8ZhNg+rPU7V05U+EHP/tI8H9xQinDo4QHaGU1oxQxZElrUnrkVIqtJhrbSp\nXxJu\r\n=FSus\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGlLRYkJ0MfCrbFY+fe4wzWZqtkMFl6VxO5UKdpAG1xAiEAvuWpqlrpYbFhDcZkvNhFKdPtvju+z+qdHtpAEdSdj4o="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.2.3_1561566685410_0.9067241930351959"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"1.2.4":{"name":"redux-model-ts","version":"1.2.4","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@1.2.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-X6v9lexRnRfuw7Woe7nC15OlPbwKEDMU5UTSrhkhWlURrU1PQ4RQVpKoe54881l7+IwqlsgRIOzhTdo+W4tupA==","shasum":"c239f1bbc2144c52a7c627b673b64287b29d161e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-1.2.4.tgz","fileCount":13,"unpackedSize":41634,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdE57LCRA9TVsSAnZWagAAWl8P/jkT8IqF6x+DPnz+o+ev\nbu4ZtAgwkdRklZPlP7+ahUfosP4+fKZ6vHIoxi9MkQ9zDFZrkOeb9B8MsjHc\nVRpsGZXEiX92eutr5ZmWyVv6WG/0Mwgl0CmArBnxIlXmw/2rnzBLnCO9Fijl\n616mJL6fWRigcwft8UFnctKGVNjyU4mOFlg3NWCBEBdv3ZfEsdxtmxusrkOP\npFFCMzD7ZWrQ60auUr9uh8G7dVvN/QaXof1IaaRgQpZ5jzN1q5HkHoviqM+7\nu6I3hq/4r8GdiYkbJLrDmBpMDJ6AiB6281xVEfyidCQLnr/yy+ZT7z7DlHxS\nfH4GWys6EHYrCAbbwf4n7PYF883ETwEpkurSBdck8mZygoxf71TCDDHww6LN\nE8Fp8N80FQ+b0HP55u90SsTZNzja+NLZo45TGDvRgBvQ7U2FWCuHIKyqoFEr\nF7/OboipV8gX+uOkAwXoTjqUOA5KX8ODTGdKdAF1Hf3Otb718IE5Yww5AHQE\ni0hzZv7/3Vt5eCJ/5VZdDxOBjVB4lYLzKaYoNt1onTCoPYAA1ItaKzuNpJY2\nmtnxo55XNQLZakrBfdHPiWF2sI/Fx+9Irg6A/ese5GDoujyozkth06ODU4in\ntRg7hMFIaBWpI25ISsBqb5XC8+7O3uuQrNlDInaMep+kWeUwmX6Hd3WJL7Rl\n7msv\r\n=ehmI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBMrp2E6+FP/42f0PPctdJRKDP4WT0py/g34sP6PJghJAiEA19tTx216Yva1Q36CTqkaEzSGvKOesGIG33/My0qHqTs="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_1.2.4_1561566923325_0.9935403959318769"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.0.0":{"name":"redux-model-ts","version":"2.0.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-ZwmRZ+j41mqfu4bqHLorcwRkRM07Lf2vtbrE43WX9l6wmRE1a4bOlyy75xZUF3s6rYiiXeUhdu+pqQLVq9s2MA==","shasum":"449676200f501b073d4f79e378f2e4e583d4e8b8","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.0.0.tgz","fileCount":14,"unpackedSize":43536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFCv/CRA9TVsSAnZWagAAGDkP+QBSevfGaazIQOTaZlQN\nF3xQoeO9pl+CYyx1odfVF7X9zPKfWheXMe/i9Swd+PGFfpA3/fvhWcyVLLu2\na3K22k2h11EdkkEhRl952S1oMbTUxcL/K7PNIKzV4T7FpwreUhgojbuockIX\n5omvnakQRmstOgwUeH+udbQgt9lFmEDiFNRJDg86e/Iv5uCuWllPMS+7DM06\nPuC2vG6c+nXySih5MHf68hUHPzvtfgOPl+nczKqXeoovxnVUUJ27IUVvM8vy\n3w9BQLjgzi06aFtE4DoETmMbJCRxQEA7mz9crXDc/vWF8Pa0GOhZIxZ0e16n\nZb65yKMOoC9riAGLJx4WL4glAc2o5Kgibh2c2TY8KeekWSUCSObN/n+umZPI\nsx7kCKsDCvB6tSrBnrFQQR5wWgwl8/9LSC2vVp669RFrnj6bpwtJcGWCV744\npPANzF4Fc0n+k7umDfD6ZpvbtNFOMW6Ih9U49UP4zc2qr8FNnKCM0DP9oHO/\nRiFqC1YbZ/Kttiv8dkg2bJ5JrNu8Uz9fT/u+vR5okd2yxjWLzi2UB09W1KUu\naX3mMOWVvzWtIvmAe1PCoiGgoTmQIxH0cIKYbeEisAh2WggYBAhrCM3yMV6P\nxSQ8q975O9EkW+CgBakVC5qEzthqRbyX0yVRVdjPKfGX4hKox9TL5nZffxOf\n3gMr\r\n=48KU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmhHBRytRRodXeabM2nsuRHjAhrBKM/AaECDKgtU89SwIgcKVke9F39qWaXEVOYSXw2/HOsyDI6aiXWWyWK1RD1Sw="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.0.0_1561603070437_0.14474196367654368"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.0.1":{"name":"redux-model-ts","version":"2.0.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-HdzbJrWWHobUxLOWOZm/zFq95DgpjtqZ+T2dpR8/CwrwmP+Gn3aTsWhSumhVHWdp2N16YxGiiKuCqtXz9hLo2Q==","shasum":"54421c7bd94cbd1aa10179de412114123f14b725","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.0.1.tgz","fileCount":14,"unpackedSize":43666,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFC13CRA9TVsSAnZWagAA2WgQAJF4nvgXeNeJ8O4PNX/Y\nryNW0ZwCu5ajJkGaFM/BQKDX7THu8y+lvkkvpiAKqvVhVKISaoCtWOxBuf+X\nZQIQAYf9garDcYmN/WLCWpcPL5RoclkCtZMisyEuTbj4vvI4q331K1BBZRJf\nltv90R1LgpHkTkMJe/4kx+anY7wt1PXX7XMi/Uh0btmL1AM28QzaGIQvCSDb\nfwsZzqmgvUOF4MI9FFAg2bcC1XNxWQTsPxugQdKXggEiseX4cxLumn7kHrOk\nMHpByGTamqgI4xmLSGz8fsZEeGs3MrT87bi9nUrIb9ps/r1diJdihl9adid8\nRO/fq0ESuKUHV0jTak6lXFSI3e4ckWeRrBhs/26MOqSQuONNf1oCe4CbJo2s\ncDrKOOyjZ56hUvktYWLAz5Rs05KicO64sixnTvXGDbS4+w/3JJEal0Ck2LmO\nspLbP8vZfLe+2sHOC95eNFvYpptdA3NNgE1VGoTfNQ5lEucSCIiUIA7srBeA\nmLo1wTWaVW8FKQjUObdfl+DB3xsa78vccTPIxrmVrre7McquPzhEub4pFDdi\nkbI0dk0QNIxVRyBxn3KLenP4V6lF7pJKB4iP3oTanM4tP76Pe7OP9xqX8uDP\nlR6zxvgbBDzEYtCduKoMh3xWQKGYsqheIj+t9JWdN1U03Xa4gTwrp+Pp7X4c\nEwh4\r\n=c9AM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrYzLQkfzdZftXOMx329Mymd98wLKrqOp3JTjsGlmUPAIgQy6jPVsbINcoH63jKOYbS8B107xS5h/R/zyttG8WWcc="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.0.1_1561603447179_0.684760637502579"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.1.0":{"name":"redux-model-ts","version":"2.1.0","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-uPI3kDIQ71N6BC/Ty+h8+oBnpNFEYwwUAksugHc6G0Ib5O7kWMckRGGZCLrnV80v3rJhli+zuENhoPdSMj59zw==","shasum":"f24bc8ecbbd216b13e32fecd678db6d0593304a7","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.1.0.tgz","fileCount":14,"unpackedSize":44934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFJoMCRA9TVsSAnZWagAA6b0P/2SnKj9aqkpn8p6nE9Sd\nwEO0Q/q8cnRLsPxZ9fBL+gIaF3mHoeZ4Pjdf9Z4Fi7w7m4Z+F986veOg5zp6\n5rz04wZ9R5sGA2bD3U9LUMmbFdjGoE8sHuWTHsqtUk0G/IzilfvcZGjJOB7g\nUP02dETTuUZx9fx4uGNMtDHrB/jfVnK+pg7njP6V61rw8iVYNf94vWdtLpjh\nlgKBozOT7nMM7tanxNRavIz3+l4n/x/y7lghjHD5HIp9QuL0CkkGXvuc5qqe\nHjGCBUYp1ks31YcM+hP4N9881ywn2u27TXWEOJlZqfmwd+IHdw9E3WeglDlO\nSJICWLwDj0f0zh6H49Nxv+jt3xCPFt7QYjIevrWU8cfiCbl/kCyiMoKAGFl3\nORvLlI+dTlma35xddIE8jFqe4xUMUkydxLa05vF/ggLgM6lwqM51w4YSMbjD\nt+ApxJxbcvOzcZkWdT3hkVDYnJGqNh36g4ecvbcGk8sC8xPSjDxoZ1qYVFzO\n+PFMWeViZZIQtNxc9TvUofGTRCq8K6uygfm2OCXGhOmCrNfh/9C6GSeoj2UI\nfAWzlyTo9hEc3bZ1k5vg1+8hnoMq8/WyGcrNiwqmbGm1gaIzKhghxAlCV4BQ\nMFmhddKF95laeG9AMnvUUersr5jPFiNthGqPInFMkDAbXlS71X4olgbblhp8\ne1w5\r\n=MSqM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDSLu4YvQoaNL6EH24H7G30YUuvt1J3+4x5h0eh2D/N/AiA5KM9Xs17AGlC/6+a2ULSHSeLKdOmFLQznrZVyBvIoKA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.1.0_1561631243471_0.12651642940862962"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.1.1":{"name":"redux-model-ts","version":"2.1.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-FLPdXzjWqbnHSnNeHDtW5NpAKOK8tLrXXuzcwX6Z3lAGljUawFPS46Q3kcn1JxtZJVdPh1oQkP6TpMsInSAK7w==","shasum":"0c035297e3fc3650522c439869f693b2f9b464a1","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.1.1.tgz","fileCount":14,"unpackedSize":44934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFJqNCRA9TVsSAnZWagAAFaUQAJj0iOHqYHiarefXNE6d\n5TXaeOj1iGFaJrt7bie/l4WQn5uU/tOeb5p2Zj1bLvtIBZ4qg+bJw+NcwdzT\nXIYeqAsmeU/BiWvJ459PprBHts0dQoEzzob5ZXX3FDB+QsogaB7/iLjsN+gs\noIGXZ8Xt6ixWRt8iyWL1Zpswmmj97U01JZ25PHQyCSyhkS5xHdYcOO2IAfZ+\nPUtulo5f5a3fYVT9bjEmZeSZeUHihvt0Dxrt3sYSJM8zkZepvXt5NzwAb3h0\n1XB2vqRBhN0UqQK2rd9GVcdgUwF3Cl0XcvAZ9aWiyBKGvr/JsyR9ulsaecOP\nZ2YeDKkTyWJAWcqd8c4pSHKZ5DUmrZN4i/Ej5xAeWzVh9qo1mUhzcYlAG2No\nNDlKoFcaM5zxYL6TSu6hfsNbDAWYBFUbkiFD9/KGsWVobRs+eI3UhRIA5ZY5\nJNzTP/8hf702fgudHfA1yVFV9FheP0McPgE3eABMMV+g3FvUXAL4iI6BFhY9\nwmpwF397vI9hAOmWtrPrgkXD0MhNr8Aps02BclXV4DZJ71/o0FOT5ZWMYFnW\nqfu1ckCzXSyhSJrktj/N/PhenQAkRAGmqLYk+b895II7lmcPfMBltIPTwlVr\nxq39yvSh1YM9cvdyTEFHTl+yBkxPXdHUic8/QTovlcMDzDmDAsUIQ6D2ZYKu\nid6F\r\n=LJNP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4l0OZnaIjrUCoXgfWd4DBixKgxoW6llm7xXG4cd9olgIgCrf3iqAp7GuaWn088GhBZ0fmEOjdReVA5e+6CkKsE+s="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.1.1_1561631372610_0.41031162331767335"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.1.2":{"name":"redux-model-ts","version":"2.1.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.1.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-9LF1bzhhfBGI0HbaAaAHdTfxY0g3P3EzB3U7o6r4+UW1EClhFsMnjQ3qoY+Vl/xLdNlOzL244SF2Med9M8ouYw==","shasum":"d7246765b75ff3cb1fb847b9fd0bedc48be540a1","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.1.2.tgz","fileCount":14,"unpackedSize":44954,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFJsACRA9TVsSAnZWagAAHm0P/2XySD9dGw3ozZTY2gtu\nZpHFUXUfuIx5qFVdds5RB/MYsAlye/KsvRMzJbmk2+G5gL7M/L8A0IJgvYvG\nQ7sZLjxYNnE/rsho2nlJdE0D7Vh10JfWYnTwV1e5UyLNqCnu5Bbe7UZ32+BJ\n4O8aGwHkqnYTxb+tfmEhBY8UuXMaDHJXtqIGywD7KpDSos3OTL1b3LC0gxOm\n3OCS2alybIdL5/edkTIfeCV6iNX8Tw1NAVnYxfEZVLRnL30Z99QyaJnYQXqN\ngPeNYsZ0Um7AP4SyR5JaF4ftDHxalbG55mSckFQwPJefr3o4SSDifZlAvg8T\n2Kn31c0XQMnh8zA8G6WE72UQ6GA3ixLoZTI1P1nepgcSrOTMgOWeLQ+i1vxO\nhITRwFD8j97H6yAcbZz/m0MsLvekrJe1iLk0u+kjL5BpNtx8UB+5pJ22Vw0Q\neT+/yOJDzaMZyIkftVipED9L/6Mf5RHJN6sPQtwbL4F+f7OGS/KYacyFV/Cy\neyKECiihE4n5u00XAXjwq5UIqJ2d6mS2wTveLJq3nkfGriUaf2kWrVI3BMDk\npePKM9cR5sCI2h3B98M4hGcG0WBIgJARvBmTuqhJ5GBHxkZBE5YQ8D/tkXjb\ndwAiHYib09+5Vsf0v1vIVaqwy5cFD65Ihx3rUsjo3/A4TBqpr864l0RgswHS\nOnXH\r\n=mr0E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDD/JPOorw69BX3nBsTErarfW0Jy2X4fBR/0AKzdl6cLgIgRmLBvFdVfF78igCb59VfuYhvRswtTgXiA3P+nJu68UQ="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.1.2_1561631487929_0.7247839301406402"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.2.1":{"name":"redux-model-ts","version":"2.2.1","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"In traditional way, we are always repeating creating actions, types, and reducers. But today, it's unnecessary to repeat your code any more once you install this package. I'll show how to release your hands and save your life.","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.2.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-lZqfKKvWV6reWrSffvBdhacTBCe8dswebX19/r0RvWXo2r4dPwK0BioBAVghuDmJoRoW+KIPHwlEMAXRKqau2Q==","shasum":"6ff759c4d8c7316e45b678b438bc05c5d12d0f8e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.2.1.tgz","fileCount":14,"unpackedSize":45365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFY1NCRA9TVsSAnZWagAA3BwP/j6+Y+wAnQTdr7N00fw+\nT4K3HaMem/rxI2jo1Ra2NXQaSVx1iROhJMIFDwNAJewrQV4lQl4zfrPauWUT\nA1hmWuZ91V/0pbcMQHmbwMisxvZlgtwkg68+pmwC4Zy/QAqxzw5/iPP+A7u6\nmoOy3RZu3nF6lEnknjesRjfj60EnjBtwISx7r4kwqgtnMzAgAco7DIid3Wfm\nDqcTvF6bbd3bEWvuRlhR0K7T/iGGAR/tNlOb7XsHsN0lJlR5toHXcAwe6ZPT\nK5tBQEfdx0HFE2aireitjqQLCt7K+U2/+2AIW/CH+c9xMEsJo5HT8OImXmGt\n+v1t0pZnn3iuJZCPg6BaD6hgdTA3yhVSNsmBQ8oIwuQWreTJGj5st8eVFKbZ\nVWTZQMgOVHL5AXH2vpq6doGzJGBllciqR8rogrJopNJroGzRnNTlFy6Sk2oK\nLyBQoOYVAA2nhA896fyxm8Ary9TiqQgap2OkcKsbXJdFLjU2imzrrUaEinvA\nj4m6nBuBUBzVFhm6Xht8dv2nJNp3XwKeoBfD/970cZ2/EqEt7ScIY+H/Hetw\nT7gzbepnjZYHHRMEtGmKq5sWKfge0z833+6yRn7iHa92yYCDBT29IfXtNGuc\nuPhSz1I8J9YXmch0RoHKloj8mwWOoidbFsIpigJ2ecmvA0vKl2AwpH8/rYuB\nN1i3\r\n=x+kS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoYtbPpTWZ56kzPAgG+OzWbuwUDoqUv77KeWVL0mUH8gIgD/3rSUYMI9CHalzsxsWU7GxKGrs3w1m5lb1IM69y+YU="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.2.1_1561693517022_0.8541984842172659"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.2.2":{"name":"redux-model-ts","version":"2.2.2","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.2.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-xqRdEmNp6LuqdhzfnU93mGNsqhIJCS3xhn2yMEn2t6NkBKz31l335r04IkdKsju7/9nXF0WiPQ2bZ4zTnk+kwQ==","shasum":"8cb92e07f21614ebab30e43a5c9ac78434c3c12f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.2.2.tgz","fileCount":14,"unpackedSize":46784,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFcVXCRA9TVsSAnZWagAAcq4P/3PjBWt1hpwIp5WLy+py\nVyn6JLe9zll/NiYWtB8UEk8qLFlAVgfQnDhbvVstEK0vhhQp2696g0s9fIXl\nZFLoFYoIG7K1TL1ANqrHPQcWu+QrV+83Jlmlv4OMSx0ET+WnYJV8abABWMaj\nUmrQ+BhH923FzLxNg7Fm0eE20nzx5CVgYwCmen4xV4On7lrXnQyC1ruCyf2t\nsxFIRJfI+fS5BrCJwH1pCv+6M0bytjRwK3tXLXUioZC+zvDogcMkUiruCAw0\nvAjftUOW4W6ENRbawA1aHPLHi3HUoEPSrSeSW9uxK47sRoai6vN7x8JB+ido\nCG8o7T+rlp0la4jasAq2GsNZLCRxCENx1sSB8gkLo1KTV585ZBr+fAzpt/RV\nO9wyNjV/HJw6j8t5CET4c3wh7cqXjx+jkGvgoG1lT/CSEvn0UecHajqcE+LZ\nvbausjgMcNSex8jnhjwOphsWFmgF7F8ahu8PaVgc03P36LWOoDjxNInajEpO\nJO0jYsF/pguHWLqFl5tgayI7Iy3Taqa+D86dxAUCpAhROEJWvkonspmuqFfe\njknjR6V80Eir7PXrsgNehux/YxKcXRpUG7bU4eE+cG76VHcIO0RA2RaazCET\nFV32BCstvFey59fo7fMRZWeIJuZMIOsluqQOAm3qWNV/1MjBZBXRjuodcMMB\n3A7k\r\n=UF0z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlO0Sp2tCfLv3YsyzCZ6x1pDmrD80+uoAi6JC8iC8Q2AiB9xBAKzsJFKlIDpllUUIjmTaNXIju00oKExfcmo7OjEQ=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.2.2_1561707862802_0.25558211944561005"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.2.3":{"name":"redux-model-ts","version":"2.2.3","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.2.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-ArEvBDOy++STXp8YN1YIm0XFmZBJ4rkANVAgzI/BMNmFPo9w67N9Mm8ge3fgbX6hoNScdqw4E/XlcfLG+j72LQ==","shasum":"44ecb71ab906afd36de57bb06b7cd6c0ee5cafc8","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.2.3.tgz","fileCount":14,"unpackedSize":46888,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFcy3CRA9TVsSAnZWagAAdnMP/0ViC8nw9G/h3W7WY0CZ\nKghKgYWQ0s8GNjXO/lGnyUDrNk6ynQ6/6bxvo97RYP2ZaSQGPvhrIz1dCxmP\nIeWxFS7d//F8qVWkXYsRzp9UA7H+MRMvyoiGNuaxSo9Enks0m54stJ8pIPk5\ndJ3YD57hSm14s44pyk36QfR8Ra1c9N9TwabvbFcF6NsQwLiAnhCtUtjn35ih\nw28HPv52BILubqAAeMSFib/8gBep1QH8oCk5UiME4a8GJrwLpptp1VoVI2wX\nbzpKXxbZ14GMPSb3UXwa59YlSo4nxO0ZgN7aW8Wep4trQJSb4i1jsipIdCQj\nbDa1xK0NvPZKu+Gy8LM2rIVkfN6YVD89zXgDt4obHeQWZjZjUKcUUf65nf6a\nYDDhAL/viROePN1dCGUiYBUHCXm0P+90bTjmGC+bFsU4ARPWlOmKf8uMFoiG\n3DCT47p+BxJu2iGrS3vM79PMiIzf54rlIxN6cmnDhMPsaBMX27eD9Ka7k2gD\nQWBGwjvfBUDiFGpOr1cIubvHsjZF46tH+hTg9axRro8ImEPTQVPdeTo18ate\nL9TUvDx9FgOooKkOG+eBeykkcrxUs+Yt6yVugv1rBPCXD6QyqM0wpNyfOKtA\nijkyyjRvaecs79oT3yQbSXNoCZeSlTtSh1MUCquuXSiCjsalq36+TgNngMSs\nVBsB\r\n=ljzc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFWJjrIoH//siQ4tEaQFz/GaReHZ7yRmFyTJStxiGxwoAiEAxxWg2Hj63e9Vt3LorIQ68W4jxgPnEIgTJP4nE/d2sVk="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.2.3_1561709750935_0.09510627190323473"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.2.4":{"name":"redux-model-ts","version":"2.2.4","main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.2.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-+EFstBSYTRL2q0M+IzIU8bmogsk37KPVYCpGiZ3GWJQBO8E/vKQi7Knk6mgFGhdLxtknmV0npnK3aWriLwiG4A==","shasum":"460067f27e64f4b922fb0ed00c7925d0c50edb7e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.2.4.tgz","fileCount":14,"unpackedSize":46903,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFdAgCRA9TVsSAnZWagAABCcP/RxhYkHzv4s6SgISsUon\np0aziZ982gRmJ7X1botQbdQUkkFMMAzMYxlUeOWCyOw6PxQMthpPGZnB+4k0\nGnXjlLsvXgnFxk7YTqOZMHqpBlnAnwkr39k5XMC0dsxPHUB+VQwevA41N75e\nIEVPg8ywe6XMXZMA+AM9L2OZ1wZtnC5KVutCG3mirXfKGljx5Zpl3JqA/C1/\ndCvNsMIVFbyLqu6hU+/OQ8MaReku6ASsOvvsn9JMz5kYHIImxspkq/ZalHI7\nlftOf9+QBYXnXwTV2+OTMSe3GRy9jSEoKPKass0RtzZzy4Qgq/azbZOV3xi4\n3nhdT9bhoKX+y9nY6ScJB1KrTlTi67/tvTiVnWBNqgw8r3KIOYJ1lctHEhhD\naDdIGVsvB8AYa3azLMq8H129R5rCGluLoMz5JrPMmTPM2NDjgr1j/KRFHYgw\np+KgzEhh5Bo72scmvZngPut8jaYDwJ2zFPeCOaflZ6oSrqYKKjrwOUncLHly\nvMZrDG1omvVcWfsPmIAoOcLTea0qh7y3jFg2hIY2PpuRwk+0QWKcyEbl4I6b\nWQYIm607aINN8Yt027pyb8rfDF5YeP8A3jAiDSemygFn73qUvmvVvQNb29ly\nvbmuiRch2X3C52hSFsGEHA+86tQW0nbg4nqx6OciNdDq0pFNf+2SbpNhy6vp\nogis\r\n=Eocg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDaX7OZ6Bc2ZDvLTL0Qtuhu5Gp3OVft1GzULnpq933cjwIhAMKWbWMIpoRctjvsVRtfqBXxySt2glN27Pe8f5zZl8kZ"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.2.4_1561710623903_0.37007278389261544"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.2.5":{"name":"redux-model-ts","version":"2.2.5","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","peerDependencies":{"react-redux":"*","redux":"*"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"dependencies":{"axios":"^0.19.0"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.2.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-G+IbWW99D2iP9qV8PApOZ03crQVFUfY6aBAqTRC8bmVwLAe3kRfY07d+0f5hBROGrF6pSmdggJVEdKRLblzw9Q==","shasum":"f8ede3fa51aa655b7d70377dfac5574a40262cbf","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.2.5.tgz","fileCount":14,"unpackedSize":46972,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFfJlCRA9TVsSAnZWagAAIqcP+QDdQPjH1tPGGmhYdMSd\nQsrPoLpWj454DpSs6E+QXI8Ri8PJgyHSydYbQYPvb9Eb1mK59fu0ZoUeKjRL\nTlkLxqevLgcLVd2b3kjao/YfC96+D1TV8OJa3rkykbGuo6GkkKA9I9nWSfX7\nWEUvxz49Z4enA2sDRGBwNfqVwYp3T25Z+WeUdZazIuRZJGFAxMNu5kWqZrYs\n/bVVIUNJkt2XtxADTOv211MTg00oEHls6ZqbqexP4URDsJnd52Oe4iPIy4di\nIHdf8uzejIN1LG7HJcsVcWvEhBS1EAA16b5r2YQwSifBdbQ6i38bIVfCVaBY\n/XdnzjrPbLP/Ewhd3G+0raMVlNuBP38G7oiyfD1DZLVV0TLM9Cbc7VZ2d2YE\nqpBhf3Qum/WLYzqlNBYlrVB4Zf0KH4Kb2P8Swl4DC7rYUIslX28Bb89rISij\n9FtDken4Y9eUDOgd0DLUSFVUIqBlbA906Xs9+j7uzh/vySE0ZdFnFnCVQGDb\nc1/kTk55kOH0aSLL1sVXzfQ8VRRoys274kWTTZ9RkPd/GOvd4fnKdj9Wmm59\ntTdqSQmPSHcxGX6opbTzI2v3y4Fvay8HZaEK1o99cY3sU125D6csYHA84BVT\naMzzGTSpWQe4+NfBXxJko9oGNbHMawMbWNeuxPFwqWlhnEll5lXkZOOTTem7\nktb9\r\n=20R9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFX08y6HhgkLRT718vJyFWk9gj9Y/4eHSbHmYtbPO6qXAiBDJxfkmAm+I4DBroW/un6NyMv4eitoisrb4oAJHhB8Yw=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.2.5_1561719396775_0.43582927985540754"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.3.0":{"name":"redux-model-ts","version":"2.3.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-FxXBaXQXJShGTWG8HxoYIZxyn1ol2Kfdpme0Ki+huBQY4/ZOVJzkgOG/90J3svsJCVTlQS/sSHLkfZfr0kOeug==","shasum":"32861075b033c0da2996f8e7a03304afb0473362","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.3.0.tgz","fileCount":42,"unpackedSize":70061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHGbHCRA9TVsSAnZWagAAEw0P/iVdZ1yDQYpodUsckliw\n/wJI9Dig2X8c5X40gUvBUVAVBq1Bdrr1csEpwn212QK7HEROUgLBLuvZz+y/\n2OZ9zd9If8vgDcNqv7B1bwPKuVAB2LuhPhijyNE/afPs91CCbIs7rSHBlxbZ\nnvKageftNz2mL11dYDOqpOHNUYI/U3maVxAJa8s++EfB7WeFZJkg/kiJT+gx\nYWVw2wrmyH053hhpSTCzd89EKE7u4DKF+T43cMhIT6Li5CNoJb822+WETc0M\nT6aHGekPJqFLl8xZae2uaf7Ib7HNnXgPDkWH0x6G3hvyXEM7j2g6TnDuRDWz\n14HYidmwTrFaMh3lFqcjcmLCbb1hfXI0yJLMKEL3qFuN6Qn579wvOxWccm/+\nELAIFYWIsTyYdPWmaiZ+Sb+qM17AFULxC8+diE7NskVaObP+nDf4qiEjZCFR\nIZDuVKPtF7upR4rWimU7dh6nE6ncij11QyOX18QYSZdw/jFUxutl8wR1ZFjB\n0n/SJEng9pKUW7/YA29VSuKyF63VoJLTXJEQaklWQwEXQfjSGdTAFr7ba476\n1/2ln/K/ff+5LnGFzU4BswjS/G5o//6K8ZvBcgH2Ypm1PTx48joh1GKrwAoz\n48F195uqreuYhfdDuBjVPFUFeSbzh7mmzyOMVfyZsKXbV5x6Ij4gPNXGDeA6\nNEDw\r\n=c0js\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCV/wwNV90MCyx6ci+66XYwb1bvAEZ+7+LVDuj/fqV6vQIgMuRrsOb35SBVBiEbzin5TUhK4i1dAlwt+uH+kx2Fnnc="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.3.0_1562142406540_0.8738816123882471"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"2.3.1":{"name":"redux-model-ts","version":"2.3.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@2.3.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-/hkNyNADBTN1uFGw4b02nnL+cQJUCyx8MIdVD/bqeyoIXTTMj68fZtwQx8s+20SNUbSlMoD/qP+uqJgV9M+MmA==","shasum":"72e5d662e98b62ab4a41dec84309fc746b0b41e1","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-2.3.1.tgz","fileCount":14,"unpackedSize":48072,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHGcECRA9TVsSAnZWagAAAXYQAI54rJxl7jEmp7xBt5B9\nhufc7ed8Mimu9EpcjbZq10fXavEAx8FmFQ+IM42PwbkkyIUcX6vfFGlGTrdR\nrrD2ohjSsGuhgCHrPR2KQjbqlYviMvOmXz+fbghmaekQZzhSvsxNyRiu6kHz\nVWeEFZZXHen/x3IHOP3VcNxkNiOEu+6HHACkThXYsw4duQm1zhJEFku29hvn\ndpJygWZNKSBP8wI0RF/ClxaNVcdzftIIj5PmHmskF0WIAOn75jJldElX5yBY\n/h+D+sn6hlzcp/XZ1ryxDBsxvnBiBOy/gKHHAtR436MfR3gYLXR9+NaWgqSf\nWIrznakXsgL1WIow/b6tIy7Tjx6yzboNRAhkzlCPgJKxwlZBE4MXbdit8sah\nRIEDyGcE969tAwFjmPErNEp2TfvIgULCZMWNKc1uATjMgXZzqvwU2OlzCt/L\ndUH8WLWwd68WHl2h01l8Mwv6ewMx5mUxzIkAG02xT7VKtGlEux5Vj2WQcvRg\nmbfeWTPWc259Jrpyzw8lqw/6ggG8SgDAkb65+TwzQXjmtdoP72H1+E+hnhDs\nL6YddKTPa3FINbjAo3asPyFE/38v8nCwPTvK6IfWrAvDbC7ijYRVrTLT79KD\np94tvsP+qDE4PcFYxthvD5GiCbYO2PVZDRer0OPt57XHABAkudwqNdsIhmV9\nzEVm\r\n=AK3b\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYOgFnBeJ5NHv/NXWkIHQwH+n2tiqEbOK2Rl0cPDM+igIhAMo50fpxuetyNSeKTf3/IVF15AYqBpT3HqzmLx8dXk3T"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_2.3.1_1562142467605_0.12018400491905634"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.0.0-rc.1":{"name":"redux-model-ts","version":"3.0.0-rc.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"readme":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。\n\n![](https://raw.githubusercontent.com/fwh1990/redux-model-ts/master/compare.jpg)\n\n# 安装\n```bash\n# 使用npm\nnpm install redux-model-ts\n\n# 或者使用yarn\nyarn add redux-model-ts\n\n```\n# 依赖\n\n\n| 插件包 | 版本 | 条件 |\n| ----- | ----- | ---- |\n| redux | * | - |\n| react | * | - |\n| react | 16.8.3+ | 使用react hooks |\n| react-redux | * | - |\n| react-redux | 7.1.0+ | 使用react hooks |\n\n# 支持\n\n该项目同时支持 `javascript` 和 `typescript`，但我推荐你使用`typescript`以得到更好的体验。下面我会用ts的案例去教你怎么使用\n\n# 运行案例\n\n克隆本项目并执行`yarn start`，然后打开浏览器输入`http://localhost:8080`查看效果\n\n# 使用方式\n\n## 普通模型\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\n\ninterface Data {\n  amount: number;\n}\n\ninterface Payload {\n  operator: '+' | '-';\n}\n\nclass Counter extends NormalModel<Data, Payload> {\n\n  action(operator: '+' | '-'): RM.NormalAction<Payload> {\n    return this.createAction({\n      operator,\n    });\n  }\n  \n  protected getInitValue(): Data {\n    return {\n      amount: 0,\n    };\n  }\n  \n  protected onSuccess(state: Data, action: RM.NormalAction<Payload>): Data {\n    let amount = state.amount;\n    \n    switch (action.payload.operator) {\n      case '+':\n        amount += 1;\n        break;\n      case '-':\n        amount -= 1;\n        break;\n      // no default\n    } \n    \n    return { amount };\n  }\n}\n\nexport const counter = new Counter();\n\n```\n现在，你已经创建了一个action和一个reducer。\n\n我们首先要把reducer挂载到redux的store中\n```typescript jsx\nimport React from 'react';\nimport ReactDom from 'react-dom';\nimport { combineReducers, Reducer, createStore, Provider } from 'redux';\nimport { EnhanceState } from 'redux-model-ts';\nimport { counter } from './Counter.ts';\n\nconst reducers = {\n  counterData: counter.createData(),\n};\n\n// 定义全局的类型`RootState`，这样我们可以在`react-redux`的connect()或者useSelector()方法中使用\ndeclare global {\n  type RootState = Readonly<ReturnType<typeof rootReducers>>;\n}\n\nconst rootReducers: Reducer<EnhanceState<typeof reducers>> = combineReducers(reducers);\n\nconst store = createStore(rootReducers);\n\nReactDom.render(\n  <Provider store={store}>\n    <App />\n  </Provider>,\n  document.getElementById('root')\n);\n\n```\n\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  render() {\n    return (\n      <div onClick={() => this.props.doAction('+')}>\n        There are {this.props.amount} people.\n      </div>\n    );\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    amount: state.counterData.amount;\n  };\n};\n\nconst mapDispatchToProps = {\n  doAction: counter.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n每当我们点击一次文字按钮，变量amount就会自动加1。\n\n#### 在React Hooks中使用\n现在，我们尝试使用react hooks来处理数据。\n\n首先，更改模型在reducer的挂载方式。也许你会发现，这样做更加方便\n```typescript\nconst reducers = {\n  // counterData: counter.createData(),\n  ...counter.hookRegister(),\n};\n```\n接着，创建一个 hooks 组件\n```typescript jsx\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport counter from 'Counter.ts';\n\nconst App: FunctionComponent = () => {\n  const amount = counter.useData((item) => item.amount);\n  const dispatch = useDispatch();\n  \n  return (\n    <div onClick={() => dispatch(counter.action('+'))}>\n      There are {amount} people.\n    </div>\n  );\n};\n```\n这种写法真是太令人兴奋了。你可以轻而易举地就拿到数据，而不需要使用connect()的方法把数据注入到props中。同时你的代码也会变得更少更简洁更易于维护。\n\n## 创建异步请求模型\n每个项目都有请求api的时候，每次请求都可能有3个状态，准备、成功和失败。这个插件利用`中间件`屏蔽了请求细节，所以在使用之前，你需要创建一个中间件\n\n#### 创建中间件\n```typescript\nimport { createRequestMiddleware, RequestModel } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware<RootState>({\n  // 模型和中间件的对应关系\n  id: RequestModel.middlewareName,\n  // 请求的通用地址前缀\n  baseUrl: 'http://api.xxx.com',\n  // 请求头信息\n  getHeaders: (api) => {\n    // header一般要带token等信息做权限校验，如果token存在reducer中，那么可以直接获取：\n    // const token = api.getState().xxx.token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // 定位业务场景下的错误码等信息，会自动存入meta中\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n  \n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message || 'Fail to fetch';\n  },\n  // 可以做一些弹窗操作。\n  // 只有当模型提供了successText属性才会触发。\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // 可以做一些弹窗操作。\n  // 只有当请求异常或者失败时才会触发。\n  // 模型中提供了 hideError 属性时，不再触发。\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n接着注入到store中\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n现在，你可以开始使用异步模型了\n\n#### 创建异步模型\n```typescript\nimport { RequestModel } from 'redux-model-ts';\n\ninterface Response {\n  name: string;\n  age: number;\n}\n\ntype Data = Partial<Response>;\n\nclass Profile extends RequestModel<Data, Response> {\n  \n  action(): RM.MiddlewareEffect<Response> {\n    return this.get('/api/profile');\n  }\n  \n  protected getInitValue(): Data {\n    return {};\n  }\n  \n  protected onSuccess(state: Data, action: RM.ResponseAction<Response>): Data {\n    return {\n      ...state,\n      ...action.response,\n    };\n  }\n}\n\nexport const profile = new Profile();\n```\n接着，我们需要把reducer挂载到redux中\n```typescript\n// 如果你想使用 connect() 方式获取数据\nconst reducers = {\n  profileData: profile.createData(),\n  // meta是指异步请求的loading，http-status，error-message 之类的数据存储\n  // 比较常用的就是loading状态\n  // 如果你不需要这些信息，那么就不挂载\n  profileMeta: profile.createMeta(),\n};\n\n// 如果你想使用 hooks 方式获取数据\nconst reducers = {\n  // 第一个参数代表是否执行：createData()\n  // 第二个参数代表是否执行：createMeta()\n  ...profile.hookRegister(true, true),\n};\n```\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  componentDidMount() {\n    this.props.getProfile();\n  }\n  \n  render() {\n    const { loading, data } = this.props;\n    \n    if (loading) {\n      return <span>Loading...</span>;\n    }\n    \n    return <div>Hello {data ? data.name : '--'}.</div>;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    data: state.profileData,\n    loading: state.profileMeta.loading,\n  };\n};\n\nconst mapDispatchToProps = {\n  getProfile: profile.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n#### 在React Hooks中使用\n```typescript jsx\nimport React, { FunctionComponent, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport profile from 'Profile.ts';\n\nconst App: FunctionComponent = () => {\n  const data = profile.useData();\n  const loading = profile.useLoading();\n  const dispatch = useDispatch();\n  \n  // 和componentDidMount一个效果\n  useEffect(() => {\n    dispatch(profile.action());\n  }, []);\n  \n  if (loading) {\n    return <span>Loading...</span>;\n  }\n  \n  return <div>Hello {data ? data.name : '--'}.</div>;\n};\n```\n\n# 创建纯action模型\n\n因为模型基于ts的语法，继承`NormalModal`和`RequestModel`的模型都需要实现**action()** | **getInitvalue()** | **onSuccess()** 方法。而纯action模型不需要reducer相关的信息，我已我们准备了另外两个类`NormalActionModel`和`RequestActionModel`。他们本质上是继承`NormalModal`和`RequestModel`，仅仅是屏蔽了reducer的相关信息。\n\n## 普通action\n```typescript jsx\nimport { NormalActionModel } from 'redux-model-ts';\n\ninterface Payload {\n  amount: number;\n}\n\nclass ChangeCounter extends NormalActionModel<Payload> {\n  action(amount: number) {\n    return this.createAction({\n      amount,\n    });\n  }\n}\n\nexport const changeCounter = new ChangeCounter();\n```\n\n## 异步请求action\n\n```typescript jsx\nimport { RequestActionModel } from 'redux-model-ts';\n\nclass UpdateProfile extends RequestActionModel {\n  action(userId: number) {\n    return this.put(`/api/profile/${userId}`, {\n      successText: '资料更新成功',\n    });\n  }\n}\n\nexport const updateProfile = new UpdateProfile();\n```\n# 副作用\n任何带有action的模型都可以产生副作用，同时任何模型都可以接收副作用\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\nimport { changeCounter } from 'ChangeCounter.ts';\n\ninterface Data {\n  amount: number;\n}\n\n// 你可以从ChangeCounter.ts中导入payload\ninterface ChangeCounterPayload {\n  amount: number;\n}\n\nclass Counter extends NormalModel<Data> {\n  \n  ...\n  \n  ...\n  \n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [\n      {\n        when: changeCounter.getSuccessType(),\n        effect: (state, action: RM.NormalAction<ChangeCounterPayload>) => {\n          return {\n            ...state,\n            amount: action.payload.amount,\n          };\n        },\n      }\n    ];\n  }\n}\n```\n\n\n# 创建纯reducer模型\n```typescript\nimport { ReducerModel } from 'redux-model-ts';\n\ninterface Data {\n  [key: string]: any;\n}\n\nclass Collector extends ReducerModel<Data> {\n  protected getInitValue() {\n    return {};\n  }\n  \n  // 这种类只能接收副作用\n  // 因为自己不产生副作用，没有onSuccess方法\n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [];\n  }\n}\n```\n\n# 数据混合\n在现实世界中，一个项目不可能只有hooks组件，有可能有stateless组件和class组件。而我们有两种数据类型挂载到redux，第一种是：`{ xxxData: xxx.createData() }`，第二种是：`{ ...yyy.hookRegister() }`。那么如何混用呢\n\n## 在class中使用\n```typescript jsx\nclass App extends PureComponent {\n  render() {\n    return null;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    // 如果是key-value形式，那么正常获取数据\n    x: state.xxxData,\n    // 如果是hookRegister形式，那么使用stateToData()方法获取数据\n    y: yyy.stateToData(state),\n  };\n};\n\nexport default connect(mapStateToProps)(App);\n```\n\n## 在hooks中使用\n```typescript jsx\nimport { useSelector } from 'react-redux';\n\nconst App: FunctionComponent = () => {\n  // 如果是key-value形式，那么借助useSelector()获取数据\n  // 当然了，你也可以直接通过connect()高阶组件注入到props\n  const x = useSelector((state: RootState) => state.xxxData);\n  // 如果是hookRegister形式，那么直接通过模型获取数据\n  const y = yyy.useData();\n  \n  return null;\n};\n\nexport default App;\n```\n","readmeFilename":"README.md","description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.0-rc.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-Gq+HmSedtllVHpHtaSxhPk6l8RqpI45F/DVAbqysBd3b92z3cHXjEatF0KEryy79CaiKloPzvm9zRIa5JQcgXQ==","shasum":"5360b7284d9ad963531a0c9140d44ec754d20558","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.0-rc.1.tgz","fileCount":6,"unpackedSize":28107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHw+hCRA9TVsSAnZWagAAw84P/A2z9PPmSiv5WQWvn/lw\nu+DpCoDVYtZ4NUvlOba2e/4/4C04TjQVC5tiAYGtz5ocyZFi8V/HPK6jzv7E\nkT3A8BMHZARGzlmIMvpIVftZ0+Mil2xwspWsXpc8jtcb+WBF//WerMuZ47Ku\nN2uG89CvUrPmUzeABLF6onRbjCf8OpqnbHx8hYMfQUdwNt+GGPiaFK7UHSNb\n0KQdyRqKLtQf4t4cZhYe0zsXD512ZnAtN3cvm0dCCfaKWBEjn6vO8/z2oIxG\n/XTfFZRP1ZWUKUkJ19xlZJQkzUfcunm4ZcV7zKCBR9W/eDibCpSUxDj4f7+d\n2gWLu4s69oA8pZcOJIDXcIPX2J/O8zYnIVnqkHRfytp2Llg9AZFl3t9+AwtA\nWBEXNL5yRSeAQcJfl6Hl3bDrHi6nqnAX8Hcnq9/QsdnIVqgOD4UZnJRwLAbh\nJievlbxU4tzUJRWRU98eq+wGiLHXReubTGbyaWuDPfciTfPwgWmM04Vus3Ts\nW+/4XtINm+ZggxSrXb0f83K0K91YRQQ0L3SRgsbJFcgpvyl9yI659QymT+q3\nykBEKYR5D60leyqx4BVlQH9+S0HL648kAxvEDglmXhO3jSX6DlOx0ELeXAUa\n0IXl6cKI7wmCzV4s1SGMsl+TEQ6p5QKTpT7vswq0M13KIKOZnZjYB0idmach\nyL4V\r\n=xJ7e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXl+epI3K/Uzq1jMclGa5ZBRA3nqJng3BrTv0i6Mrj9AiBCOpejmQ2MAMxlAOe8qU9GZ3GrAe+pO1hOPfCOBBA/qA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.0-rc.1_1562316705195_0.08087018603709839"},"_hasShrinkwrap":false},"3.0.0-rc.2":{"name":"redux-model-ts","version":"3.0.0-rc.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"readme":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。\n\n![](https://raw.githubusercontent.com/fwh1990/redux-model-ts/master/compare.jpg)\n\n# 安装\n```bash\n# 使用npm\nnpm install redux-model-ts\n\n# 或者使用yarn\nyarn add redux-model-ts\n\n```\n# 依赖\n\n\n| 插件包 | 版本 | 条件 |\n| ----- | ----- | ---- |\n| redux | * | - |\n| react | * | - |\n| react | 16.8.3+ | 使用react hooks |\n| react-redux | * | - |\n| react-redux | 7.1.0+ | 使用react hooks |\n\n# 支持\n\n该项目同时支持 `javascript` 和 `typescript`，但我推荐你使用`typescript`以得到更好的体验。下面我会用ts的案例去教你怎么使用\n\n# 运行案例\n\n克隆本项目并执行`yarn start`，然后打开浏览器输入`http://localhost:8080`查看效果\n\n# 使用方式\n\n## 普通模型\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\n\ninterface Data {\n  amount: number;\n}\n\ninterface Payload {\n  operator: '+' | '-';\n}\n\nclass Counter extends NormalModel<Data, Payload> {\n\n  action(operator: '+' | '-'): RM.NormalAction<Payload> {\n    return this.createAction({\n      operator,\n    });\n  }\n  \n  protected getInitValue(): Data {\n    return {\n      amount: 0,\n    };\n  }\n  \n  protected onSuccess(state: Data, action: RM.NormalAction<Payload>): Data {\n    let amount = state.amount;\n    \n    switch (action.payload.operator) {\n      case '+':\n        amount += 1;\n        break;\n      case '-':\n        amount -= 1;\n        break;\n      // no default\n    } \n    \n    return { amount };\n  }\n}\n\nexport const counter = new Counter();\n\n```\n现在，你已经创建了一个action和一个reducer。\n\n我们首先要把reducer挂载到redux的store中\n```typescript jsx\nimport React from 'react';\nimport ReactDom from 'react-dom';\nimport { combineReducers, Reducer, createStore, Provider } from 'redux';\nimport { EnhanceState } from 'redux-model-ts';\nimport { counter } from './Counter.ts';\n\nconst reducers = {\n  counterData: counter.createData(),\n};\n\n// 定义全局的类型`RootState`，这样我们可以在`react-redux`的connect()或者useSelector()方法中使用\ndeclare global {\n  type RootState = Readonly<ReturnType<typeof rootReducers>>;\n}\n\nconst rootReducers: Reducer<EnhanceState<typeof reducers>> = combineReducers(reducers);\n\nconst store = createStore(rootReducers);\n\nReactDom.render(\n  <Provider store={store}>\n    <App />\n  </Provider>,\n  document.getElementById('root')\n);\n\n```\n\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  render() {\n    return (\n      <div onClick={() => this.props.doAction('+')}>\n        There are {this.props.amount} people.\n      </div>\n    );\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    amount: state.counterData.amount;\n  };\n};\n\nconst mapDispatchToProps = {\n  doAction: counter.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n每当我们点击一次文字按钮，变量amount就会自动加1。\n\n#### 在React Hooks中使用\n现在，我们尝试使用react hooks来处理数据。\n\n首先，更改模型在reducer的挂载方式。也许你会发现，这样做更加方便\n```typescript\nconst reducers = {\n  // counterData: counter.createData(),\n  ...counter.hookRegister(),\n};\n```\n接着，创建一个 hooks 组件\n```typescript jsx\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport counter from 'Counter.ts';\n\nconst App: FunctionComponent = () => {\n  const amount = counter.useData((item) => item.amount);\n  const dispatch = useDispatch();\n  \n  return (\n    <div onClick={() => dispatch(counter.action('+'))}>\n      There are {amount} people.\n    </div>\n  );\n};\n```\n这种写法真是太令人兴奋了。你可以轻而易举地就拿到数据，而不需要使用connect()的方法把数据注入到props中。同时你的代码也会变得更少更简洁更易于维护。\n\n## 创建异步请求模型\n每个项目都有请求api的时候，每次请求都可能有3个状态，准备、成功和失败。这个插件利用`中间件`屏蔽了请求细节，所以在使用之前，你需要创建一个中间件\n\n#### 创建中间件\n```typescript\nimport { createRequestMiddleware, RequestModel } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware<RootState>({\n  // 模型和中间件的对应关系\n  id: RequestModel.middlewareName,\n  // 请求的通用地址前缀\n  baseUrl: 'http://api.xxx.com',\n  // 请求头信息\n  getHeaders: (api) => {\n    // header一般要带token等信息做权限校验，如果token存在reducer中，那么可以直接获取：\n    // const token = api.getState().xxx.token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // 定位业务场景下的错误码等信息，会自动存入meta中\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n  \n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message || 'Fail to fetch';\n  },\n  // 可以做一些弹窗操作。\n  // 只有当模型提供了successText属性才会触发。\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // 可以做一些弹窗操作。\n  // 只有当请求异常或者失败时才会触发。\n  // 模型中提供了 hideError 属性时，不再触发。\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n接着注入到store中\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n现在，你可以开始使用异步模型了\n\n#### 创建异步模型\n```typescript\nimport { RequestModel } from 'redux-model-ts';\n\ninterface Response {\n  name: string;\n  age: number;\n}\n\ntype Data = Partial<Response>;\n\nclass Profile extends RequestModel<Data, Response> {\n  \n  action(): RM.MiddlewareEffect<Response> {\n    return this.get('/api/profile');\n  }\n  \n  protected getInitValue(): Data {\n    return {};\n  }\n  \n  protected onSuccess(state: Data, action: RM.ResponseAction<Response>): Data {\n    return {\n      ...state,\n      ...action.response,\n    };\n  }\n}\n\nexport const profile = new Profile();\n```\n接着，我们需要把reducer挂载到redux中\n```typescript\n// 如果你想使用 connect() 方式获取数据\nconst reducers = {\n  profileData: profile.createData(),\n  // meta是指异步请求的loading，http-status，error-message 之类的数据存储\n  // 比较常用的就是loading状态\n  // 如果你不需要这些信息，那么就不挂载\n  profileMeta: profile.createMeta(),\n};\n\n// 如果你想使用 hooks 方式获取数据\nconst reducers = {\n  // 第一个参数代表是否执行：createData()\n  // 第二个参数代表是否执行：createMeta()\n  ...profile.hookRegister(true, true),\n};\n```\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  componentDidMount() {\n    this.props.getProfile();\n  }\n  \n  render() {\n    const { loading, data } = this.props;\n    \n    if (loading) {\n      return <span>Loading...</span>;\n    }\n    \n    return <div>Hello {data ? data.name : '--'}.</div>;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    data: state.profileData,\n    loading: state.profileMeta.loading,\n  };\n};\n\nconst mapDispatchToProps = {\n  getProfile: profile.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n#### 在React Hooks中使用\n```typescript jsx\nimport React, { FunctionComponent, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport profile from 'Profile.ts';\n\nconst App: FunctionComponent = () => {\n  const data = profile.useData();\n  const loading = profile.useLoading();\n  const dispatch = useDispatch();\n  \n  // 和componentDidMount一个效果\n  useEffect(() => {\n    dispatch(profile.action());\n  }, []);\n  \n  if (loading) {\n    return <span>Loading...</span>;\n  }\n  \n  return <div>Hello {data ? data.name : '--'}.</div>;\n};\n```\n\n# 创建纯action模型\n\n因为模型基于ts的语法，继承`NormalModal`和`RequestModel`的模型都需要实现**action()** | **getInitvalue()** | **onSuccess()** 方法。而纯action模型不需要reducer相关的信息，我已我们准备了另外两个类`NormalActionModel`和`RequestActionModel`。他们本质上是继承`NormalModal`和`RequestModel`，仅仅是屏蔽了reducer的相关信息。\n\n## 普通action\n```typescript jsx\nimport { NormalActionModel } from 'redux-model-ts';\n\ninterface Payload {\n  amount: number;\n}\n\nclass ChangeCounter extends NormalActionModel<Payload> {\n  action(amount: number) {\n    return this.createAction({\n      amount,\n    });\n  }\n}\n\nexport const changeCounter = new ChangeCounter();\n```\n\n## 异步请求action\n\n```typescript jsx\nimport { RequestActionModel } from 'redux-model-ts';\n\nclass UpdateProfile extends RequestActionModel {\n  action(userId: number) {\n    return this.put(`/api/profile/${userId}`, {\n      successText: '资料更新成功',\n    });\n  }\n}\n\nexport const updateProfile = new UpdateProfile();\n```\n# 副作用\n任何带有action的模型都可以产生副作用，同时任何模型都可以接收副作用\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\nimport { changeCounter } from 'ChangeCounter.ts';\n\ninterface Data {\n  amount: number;\n}\n\n// 你可以从ChangeCounter.ts中导入payload\ninterface ChangeCounterPayload {\n  amount: number;\n}\n\nclass Counter extends NormalModel<Data> {\n  \n  ...\n  \n  ...\n  \n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [\n      {\n        when: changeCounter.getSuccessType(),\n        effect: (state, action: RM.NormalAction<ChangeCounterPayload>) => {\n          return {\n            ...state,\n            amount: action.payload.amount,\n          };\n        },\n      }\n    ];\n  }\n}\n```\n\n\n# 创建纯reducer模型\n```typescript\nimport { ReducerModel } from 'redux-model-ts';\n\ninterface Data {\n  [key: string]: any;\n}\n\nclass Collector extends ReducerModel<Data> {\n  protected getInitValue() {\n    return {};\n  }\n  \n  // 这种类只能接收副作用\n  // 因为自己不产生副作用，没有onSuccess方法\n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [];\n  }\n}\n```\n\n# 数据混合\n在现实世界中，一个项目不可能只有hooks组件，有可能有stateless组件和class组件。而我们有两种数据类型挂载到redux，第一种是：`{ xxxData: xxx.createData() }`，第二种是：`{ ...yyy.hookRegister() }`。那么如何混用呢\n\n## 在class中使用\n```typescript jsx\nclass App extends PureComponent {\n  render() {\n    return null;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    // 如果是key-value形式，那么正常获取数据\n    x: state.xxxData,\n    // 如果是hookRegister形式，那么使用stateToData()方法获取数据\n    y: yyy.stateToData(state),\n  };\n};\n\nexport default connect(mapStateToProps)(App);\n```\n\n## 在hooks中使用\n```typescript jsx\nimport { useSelector } from 'react-redux';\n\nconst App: FunctionComponent = () => {\n  // 如果是key-value形式，那么借助useSelector()获取数据\n  // 当然了，你也可以直接通过connect()高阶组件注入到props\n  const x = useSelector((state: RootState) => state.xxxData);\n  // 如果是hookRegister形式，那么直接通过模型获取数据\n  const y = yyy.useData();\n  \n  return null;\n};\n\nexport default App;\n```\n","readmeFilename":"README.md","description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.0-rc.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-gOpGzPK1qtAnDRdgR2NMFyUwWFeF7eoJ3tca56zjnVPYNd0AeixzGLIb9+udN/bVczbwPtn0c+D2WaLq/o9bqg==","shasum":"6d2c4e39ba0f61506eb10e0b58f9b53e475fdb6f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.0-rc.2.tgz","fileCount":6,"unpackedSize":28161,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHxtPCRA9TVsSAnZWagAAmZUP/17lLYGjk/HLo1SOr/fY\nqHuUZhB1dv+rPNI2gSMCuOBt09kBHEYV6JpzczpGBnudT9HIlKvuQI0Z4vAa\nM9LTyiXyBr7YogeiSVz+X+xXjOPfx4avEplM2YIiOX0PFtsYFJSoUbEWgqRu\nJ2CpvmBoaIi2KGE2pNanwA6KEYI5KOXFjbpu4wd5e8PuK8UBjgxPCMUQLfyK\ns6O//QjR+W5q3m0LQvJ/D5a4AjyiM2frVCzK1v/G9AcgoBrcQd/GY5yx/jYn\nm34XaKpneawc6ewSsL9VoOQ8hqghVnx7/5AT5h1/h914DUkRWrDubl3i8waw\n7wHS+prVhWJMhEfCqPNovLryuYlN3Or7xaXvqYmE5VCet1UHBG1QC/Mb7bs0\nfRTkddeoke753cvczLtdttf7KL9uXPCghWSFTwb6a6HhXtJtysgyl1i+dgWd\nuwCzSCquX8bQOJk8HfCL5buaxC9BFQGk5xNUL4rHKJcqNjugL8nKRoScvXOi\nXlNgasENponMANZ+TKvQ9SOBE63xyDAJCqtGOhuI0ki8CmKr02sm8K8rHddK\nJJTlqZIMJhvQns1bepZmzXOrHvPa5gXLdmqhjXdC9HMirPQkGNJc21R65vMA\nBNeGWN8gF+pGXo7+6csMvCaEJZZVc+EvvcmcYfxZ93ERzcDkp1ZzgDpQs7Oc\n0vOW\r\n=P/jT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbzWopF39ox47UeB7KMkXmYEvfK0DG8IAkpMAM9uke4AIhAPvI++fylhF4hthom3LmnnNt9oyzhQ9eBlSEtYUOb5QQ"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.0-rc.2_1562319694782_0.9329005174925709"},"_hasShrinkwrap":false},"3.0.0-rc.3":{"name":"redux-model-ts","version":"3.0.0-rc.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"readme":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。\n\n![](https://raw.githubusercontent.com/fwh1990/redux-model-ts/master/compare.jpg)\n\n# 安装\n```bash\n# 使用npm\nnpm install redux-model-ts\n\n# 或者使用yarn\nyarn add redux-model-ts\n\n```\n# 依赖\n\n\n| 插件包 | 版本 | 条件 |\n| ----- | ----- | ---- |\n| redux | * | - |\n| react | * | - |\n| react | 16.8.3+ | 使用react hooks |\n| react-redux | * | - |\n| react-redux | 7.1.0+ | 使用react hooks |\n\n# 支持\n\n该项目同时支持 `javascript` 和 `typescript`，但我推荐你使用`typescript`以得到更好的体验。下面我会用ts的案例去教你怎么使用\n\n# 运行案例\n\n克隆本项目并执行`yarn start`，然后打开浏览器输入`http://localhost:8080`查看效果\n\n# 使用方式\n\n## 普通模型\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\n\ninterface Data {\n  amount: number;\n}\n\ninterface Payload {\n  operator: '+' | '-';\n}\n\nclass Counter extends NormalModel<Data, Payload> {\n\n  action(operator: '+' | '-'): RM.NormalAction<Payload> {\n    return this.createAction({\n      operator,\n    });\n  }\n  \n  protected getInitValue(): Data {\n    return {\n      amount: 0,\n    };\n  }\n  \n  protected onSuccess(state: Data, action: RM.NormalAction<Payload>): Data {\n    let amount = state.amount;\n    \n    switch (action.payload.operator) {\n      case '+':\n        amount += 1;\n        break;\n      case '-':\n        amount -= 1;\n        break;\n      // no default\n    } \n    \n    return { amount };\n  }\n}\n\nexport const counter = new Counter();\n\n```\n现在，你已经创建了一个action和一个reducer。\n\n我们首先要把reducer挂载到redux的store中\n```typescript jsx\nimport React from 'react';\nimport ReactDom from 'react-dom';\nimport { combineReducers, Reducer, createStore, Provider } from 'redux';\nimport { EnhanceState } from 'redux-model-ts';\nimport { counter } from './Counter.ts';\n\nconst reducers = {\n  counterData: counter.createData(),\n};\n\n// 定义全局的类型`RootState`，这样我们可以在`react-redux`的connect()或者useSelector()方法中使用\ndeclare global {\n  type RootState = Readonly<ReturnType<typeof rootReducers>>;\n}\n\nconst rootReducers: Reducer<EnhanceState<typeof reducers>> = combineReducers(reducers);\n\nconst store = createStore(rootReducers);\n\nReactDom.render(\n  <Provider store={store}>\n    <App />\n  </Provider>,\n  document.getElementById('root')\n);\n\n```\n\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  render() {\n    return (\n      <div onClick={() => this.props.doAction('+')}>\n        There are {this.props.amount} people.\n      </div>\n    );\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    amount: state.counterData.amount;\n  };\n};\n\nconst mapDispatchToProps = {\n  doAction: counter.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n每当我们点击一次文字按钮，变量amount就会自动加1。\n\n#### 在React Hooks中使用\n现在，我们尝试使用react hooks来处理数据。\n\n首先，更改模型在reducer的挂载方式。也许你会发现，这样做更加方便\n```typescript\nconst reducers = {\n  // counterData: counter.createData(),\n  ...counter.hookRegister(),\n};\n```\n接着，创建一个 hooks 组件\n```typescript jsx\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport counter from 'Counter.ts';\n\nconst App: FunctionComponent = () => {\n  const amount = counter.useData((item) => item.amount);\n  const dispatch = useDispatch();\n  \n  return (\n    <div onClick={() => dispatch(counter.action('+'))}>\n      There are {amount} people.\n    </div>\n  );\n};\n```\n这种写法真是太令人兴奋了。你可以轻而易举地就拿到数据，而不需要使用connect()的方法把数据注入到props中。同时你的代码也会变得更少更简洁更易于维护。\n\n## 创建异步请求模型\n每个项目都有请求api的时候，每次请求都可能有3个状态，准备、成功和失败。这个插件利用`中间件`屏蔽了请求细节，所以在使用之前，你需要创建一个中间件\n\n#### 创建中间件\n```typescript\nimport { createRequestMiddleware, RequestModel } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware<RootState>({\n  // 模型和中间件的对应关系\n  id: RequestModel.middlewareName,\n  // 请求的通用地址前缀\n  baseUrl: 'http://api.xxx.com',\n  // 请求头信息\n  getHeaders: (api) => {\n    // header一般要带token等信息做权限校验，如果token存在reducer中，那么可以直接获取：\n    // const token = api.getState().xxx.token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // 定位业务场景下的错误码等信息，会自动存入meta中\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n  \n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message || 'Fail to fetch';\n  },\n  // 可以做一些弹窗操作。\n  // 只有当模型提供了successText属性才会触发。\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // 可以做一些弹窗操作。\n  // 只有当请求异常或者失败时才会触发。\n  // 模型中提供了 hideError 属性时，不再触发。\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n接着注入到store中\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n现在，你可以开始使用异步模型了\n\n#### 创建异步模型\n```typescript\nimport { RequestModel } from 'redux-model-ts';\n\ninterface Response {\n  name: string;\n  age: number;\n}\n\ntype Data = Partial<Response>;\n\nclass Profile extends RequestModel<Data, Response> {\n  \n  action(): RM.MiddlewareEffect<Response> {\n    return this.get('/api/profile');\n  }\n  \n  protected getInitValue(): Data {\n    return {};\n  }\n  \n  protected onSuccess(state: Data, action: RM.ResponseAction<Response>): Data {\n    return {\n      ...state,\n      ...action.response,\n    };\n  }\n}\n\nexport const profile = new Profile();\n```\n接着，我们需要把reducer挂载到redux中\n```typescript\n// 如果你想使用 connect() 方式获取数据\nconst reducers = {\n  profileData: profile.createData(),\n  // meta是指异步请求的loading，http-status，error-message 之类的数据存储\n  // 比较常用的就是loading状态\n  // 如果你不需要这些信息，那么就不挂载\n  profileMeta: profile.createMeta(),\n};\n\n// 如果你想使用 hooks 方式获取数据\nconst reducers = {\n  // 第一个参数代表是否执行：createData()\n  // 第二个参数代表是否执行：createMeta()\n  ...profile.hookRegister(true, true),\n};\n```\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  componentDidMount() {\n    this.props.getProfile();\n  }\n  \n  render() {\n    const { loading, data } = this.props;\n    \n    if (loading) {\n      return <span>Loading...</span>;\n    }\n    \n    return <div>Hello {data ? data.name : '--'}.</div>;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    data: state.profileData,\n    loading: state.profileMeta.loading,\n  };\n};\n\nconst mapDispatchToProps = {\n  getProfile: profile.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n#### 在React Hooks中使用\n```typescript jsx\nimport React, { FunctionComponent, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport profile from 'Profile.ts';\n\nconst App: FunctionComponent = () => {\n  const data = profile.useData();\n  const loading = profile.useLoading();\n  const dispatch = useDispatch();\n  \n  // 和componentDidMount一个效果\n  useEffect(() => {\n    dispatch(profile.action());\n  }, []);\n  \n  if (loading) {\n    return <span>Loading...</span>;\n  }\n  \n  return <div>Hello {data ? data.name : '--'}.</div>;\n};\n```\n\n# 创建纯action模型\n\n因为模型基于ts的语法，继承`NormalModal`和`RequestModel`的模型都需要实现**action()** | **getInitvalue()** | **onSuccess()** 方法。而纯action模型不需要reducer相关的信息，我已我们准备了另外两个类`NormalActionModel`和`RequestActionModel`。他们本质上是继承`NormalModal`和`RequestModel`，仅仅是屏蔽了reducer的相关信息。\n\n## 普通action\n```typescript jsx\nimport { NormalActionModel } from 'redux-model-ts';\n\ninterface Payload {\n  amount: number;\n}\n\nclass ChangeCounter extends NormalActionModel<Payload> {\n  action(amount: number) {\n    return this.createAction({\n      amount,\n    });\n  }\n}\n\nexport const changeCounter = new ChangeCounter();\n```\n\n## 异步请求action\n\n```typescript jsx\nimport { RequestActionModel } from 'redux-model-ts';\n\nclass UpdateProfile extends RequestActionModel {\n  action(userId: number) {\n    return this.put(`/api/profile/${userId}`, {\n      successText: '资料更新成功',\n    });\n  }\n}\n\nexport const updateProfile = new UpdateProfile();\n```\n# 副作用\n任何带有action的模型都可以产生副作用，同时任何模型都可以接收副作用\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\nimport { changeCounter } from 'ChangeCounter.ts';\n\ninterface Data {\n  amount: number;\n}\n\n// 你可以从ChangeCounter.ts中导入payload\ninterface ChangeCounterPayload {\n  amount: number;\n}\n\nclass Counter extends NormalModel<Data> {\n  \n  ...\n  \n  ...\n  \n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [\n      {\n        when: changeCounter.getSuccessType(),\n        effect: (state, action: RM.NormalAction<ChangeCounterPayload>) => {\n          return {\n            ...state,\n            amount: action.payload.amount,\n          };\n        },\n      }\n    ];\n  }\n}\n```\n\n\n# 创建纯reducer模型\n```typescript\nimport { ReducerModel } from 'redux-model-ts';\n\ninterface Data {\n  [key: string]: any;\n}\n\nclass Collector extends ReducerModel<Data> {\n  protected getInitValue() {\n    return {};\n  }\n  \n  // 这种类只能接收副作用\n  // 因为自己不产生副作用，没有onSuccess方法\n  protected getEffects(): RM.ReducerEffects<Data> {\n    return [];\n  }\n}\n```\n\n# 数据混合\n在现实世界中，一个项目不可能只有hooks组件，有可能有stateless组件和class组件。而我们有两种数据类型挂载到redux，第一种是：`{ xxxData: xxx.createData() }`，第二种是：`{ ...yyy.hookRegister() }`。那么如何混用呢\n\n## 在class中使用\n```typescript jsx\nclass App extends PureComponent {\n  render() {\n    return null;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    // 如果是key-value形式，那么正常获取数据\n    x: state.xxxData,\n    // 如果是hookRegister形式，那么使用stateToData()方法获取数据\n    y: yyy.stateToData(state),\n  };\n};\n\nexport default connect(mapStateToProps)(App);\n```\n\n## 在hooks中使用\n```typescript jsx\nimport { useSelector } from 'react-redux';\n\nconst App: FunctionComponent = () => {\n  // 如果是key-value形式，那么借助useSelector()获取数据\n  // 当然了，你也可以直接通过connect()高阶组件注入到props\n  const x = useSelector((state: RootState) => state.xxxData);\n  // 如果是hookRegister形式，那么直接通过模型获取数据\n  const y = yyy.useData();\n  \n  return null;\n};\n\nexport default App;\n```\n","readmeFilename":"README.md","description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.0-rc.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-BM0FUMyrhaB0E5yi/jUquu9TFsndhm98M7NfK1LvEgomQ8Bgtr9cLIe+STjZeaEjkidVMJB8qfRNPveOSo2MKg==","shasum":"13856d6a33be594905f9d321e16920ba15ceeaa9","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.0-rc.3.tgz","fileCount":13,"unpackedSize":48928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHx2hCRA9TVsSAnZWagAA8O0QAIzjQxFfjt1aib47JhHL\nub6UnOZoKqsEqnnb4a76Nbv4Qs+C4TpvNoBhHquFPLG9ekX33KzinZZfyFNd\npvovT45JY5XS3tm+46fmPEpUv1YcGXi6EEZY252StR28uiuyhPb0TuK5pLQB\nwOBwwRdSMDhzdR9BvxI+ub7xoHc5zRNkffo5M5kpzQC4HxZ6hT/i8BxYvzBN\nkByPpxWI3Xrjd46lWf9maPux0AeH4kPvTk0PbgLHkNE+difJcmc6cOpuzgov\nQduroEVZDn8lXAhgYUIsuaPBPhMdQWl9lh/rng52MbdQfX3mloVZye/sfyYg\n9LWjmputCmPSPFINaWMUwcGromzerocvg8RRQnkNDnKJV8fAXCVssYEIySpS\n+ctj4GYAr9S8lrYoIDzPO/qdCYIu4cnZrBU6HrEx2gc/dlBrkN4FqTmK14V7\n/9sn8ZxWPC2Ic3QftpNriuNETzg4I2KQFGKErFzt6AWZI3jq9UkIM61B6Pe/\ntERbGe/rWOPWEusUHKdhReorpH3X+ko60aKOcrE0/aqKCRbdBskWeF3hxfFp\n28cmzwajKBUF0rJ8Os0uPLA5DhDQTKmL8kBhvSxAWlYlBX4tu4C/PW75lu8t\n8bdFn19+96GUvdiOaephpwfv85c0L/VfW+fq0ngabmstfueaViSU6WddCqYw\n3pvI\r\n=Mgao\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE5Ry1sPdIXNE+OGoTT8LIhYn4EonBFvcBgLW9vBreqgAiAoa3MfImqTclzpqihB/7Ypi1bp36XGt8UTPZwsaoPb5A=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.0-rc.3_1562320288562_0.24649153595301043"},"_hasShrinkwrap":false},"3.0.0-rc.4":{"name":"redux-model-ts","version":"3.0.0-rc.4","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"readme":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。\n\n![](https://raw.githubusercontent.com/fwh1990/redux-model-ts/master/compare.jpg)\n\n# 安装\n```bash\n# 使用npm\nnpm install redux-model-ts\n\n# 或者使用yarn\nyarn add redux-model-ts\n\n```\n# 依赖\n\n\n| 插件包 | 版本 | 条件 |\n| ----- | ----- | ---- |\n| redux | * | - |\n| react | * | - |\n| react | 16.8.3+ | 使用react hooks |\n| react-redux | * | - |\n| react-redux | 7.1.0+ | 使用react hooks |\n\n# 支持\n\n该项目同时支持 `javascript` 和 `typescript`，但我推荐你使用`typescript`以得到更好的体验。下面我会用ts的案例去教你怎么使用\n\n# 运行案例\n\n克隆本项目并执行`yarn start`，然后打开浏览器输入`http://localhost:8080`查看效果\n\n# 使用方式\n\n## 普通模型\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\n\ninterface Data {\n  amount: number;\n}\n\ninterface Payload {\n  operator: '+' | '-';\n}\n\nclass Counter extends NormalModel<Data, Payload> {\n\n  action(operator: '+' | '-'): RM.NormalAction<Payload> {\n    return this.createAction({\n      operator,\n    });\n  }\n  \n  protected getInitValue(): Data {\n    return {\n      amount: 0,\n    };\n  }\n  \n  protected onSuccess(state: Data, action: RM.NormalAction<Payload>): Data {\n    let amount = state.amount;\n    \n    switch (action.payload.operator) {\n      case '+':\n        amount += 1;\n        break;\n      case '-':\n        amount -= 1;\n        break;\n      // no default\n    } \n    \n    return { amount };\n  }\n}\n\nexport const counter = new Counter();\n\n```\n现在，你已经创建了一个action和一个reducer。\n\n我们首先要把reducer挂载到redux的store中\n```typescript jsx\nimport React from 'react';\nimport ReactDom from 'react-dom';\nimport { combineReducers, Reducer, createStore, Provider } from 'redux';\nimport { EnhanceState } from 'redux-model-ts';\nimport { counter } from './Counter.ts';\n\nconst reducers = {\n  counterData: counter.createData(),\n};\n\n// 定义全局的类型`RootState`，这样我们可以在`react-redux`的connect()或者useSelector()方法中使用\ndeclare global {\n  type RootState = Readonly<ReturnType<typeof rootReducers>>;\n}\n\nconst rootReducers: Reducer<EnhanceState<typeof reducers>> = combineReducers(reducers);\n\nconst store = createStore(rootReducers);\n\nReactDom.render(\n  <Provider store={store}>\n    <App />\n  </Provider>,\n  document.getElementById('root')\n);\n\n```\n\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  render() {\n    return (\n      <div onClick={() => this.props.doAction('+')}>\n        There are {this.props.amount} people.\n      </div>\n    );\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    amount: state.counterData.amount;\n  };\n};\n\nconst mapDispatchToProps = {\n  doAction: counter.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n每当我们点击一次文字按钮，变量amount就会自动加1。\n\n#### 在React Hooks中使用\n现在，我们尝试使用react hooks来处理数据。\n\n首先，更改模型在reducer的挂载方式。也许你会发现，这样做更加方便\n```typescript\nconst reducers = {\n  // counterData: counter.createData(),\n  ...counter.hookRegister(),\n};\n```\n接着，创建一个 hooks 组件\n```typescript jsx\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport counter from 'Counter.ts';\n\nconst App: FunctionComponent = () => {\n  const amount = counter.useData((item) => item.amount);\n  const dispatch = useDispatch();\n  \n  return (\n    <div onClick={() => dispatch(counter.action('+'))}>\n      There are {amount} people.\n    </div>\n  );\n};\n```\n这种写法真是太令人兴奋了。你可以轻而易举地就拿到数据，而不需要使用connect()的方法把数据注入到props中。同时你的代码也会变得更少更简洁更易于维护。\n\n## 创建异步请求模型\n每个项目都有请求api的时候，每次请求都可能有3个状态，准备、成功和失败。这个插件利用`中间件`屏蔽了请求细节，所以在使用之前，你需要创建一个中间件\n\n#### 创建中间件\n```typescript\nimport { createRequestMiddleware, RequestModel } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware<RootState>({\n  // 模型和中间件的对应关系\n  id: RequestModel.middlewareName,\n  // 请求的通用地址前缀\n  baseUrl: 'http://api.xxx.com',\n  // 请求头信息\n  getHeaders: (api) => {\n    // header一般要带token等信息做权限校验，如果token存在reducer中，那么可以直接获取：\n    // const token = api.getState().xxx.token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // 定位业务场景下的错误码等信息，会自动存入meta中\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n  \n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message || 'Fail to fetch';\n  },\n  // 可以做一些弹窗操作。\n  // 只有当模型提供了successText属性才会触发。\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // 可以做一些弹窗操作。\n  // 只有当请求异常或者失败时才会触发。\n  // 模型中提供了 hideError 属性时，不再触发。\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n接着注入到store中\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n现在，你可以开始使用异步模型了\n\n#### 创建异步模型\n```typescript\nimport { RequestModel } from 'redux-model-ts';\n\ninterface Response {\n  name: string;\n  age: number;\n}\n\ntype Data = Partial<Response>;\n\nclass Profile extends RequestModel<Data, Response> {\n  \n  action(): RM.FetchHandle<Response> {\n    return this.get('/api/profile');\n  }\n  \n  protected getInitValue(): Data {\n    return {};\n  }\n  \n  protected onSuccess(state: Data, action: RM.ResponseAction<Response>): Data {\n    return {\n      ...state,\n      ...action.response,\n    };\n  }\n}\n\nexport const profile = new Profile();\n```\n接着，我们需要把reducer挂载到redux中\n```typescript\n// 如果你想使用 connect() 方式获取数据\nconst reducers = {\n  profileData: profile.createData(),\n  // meta是指异步请求的loading，http-status，error-message 之类的数据存储\n  // 比较常用的就是loading状态\n  // 如果你不需要这些信息，那么就不挂载\n  profileMeta: profile.createMeta(),\n};\n\n// 如果你想使用 hooks 方式获取数据\nconst reducers = {\n  // 第一个参数代表是否执行：createData()\n  // 第二个参数代表是否执行：createMeta()\n  ...profile.hookRegister(true, true),\n};\n```\n#### 在React Class中使用\n```typescript jsx\nimport React, { PureComponent } from' react';\nimport { connect } from 'react-redux';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nclass App extends PureComponent<Props> {\n  componentDidMount() {\n    this.props.getProfile();\n  }\n  \n  render() {\n    const { loading, data } = this.props;\n    \n    if (loading) {\n      return <span>Loading...</span>;\n    }\n    \n    return <div>Hello {data ? data.name : '--'}.</div>;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    data: state.profileData,\n    loading: state.profileMeta.loading,\n  };\n};\n\nconst mapDispatchToProps = {\n  getProfile: profile.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\n#### 在React Hooks中使用\n```typescript jsx\nimport React, { FunctionComponent, useEffect } from 'react';\nimport { useDispatch } from 'react-redux';\nimport profile from 'Profile.ts';\n\nconst App: FunctionComponent = () => {\n  const data = profile.useData();\n  const loading = profile.useLoading();\n  const dispatch = useDispatch();\n  \n  // 和componentDidMount一个效果\n  useEffect(() => {\n    dispatch(profile.action());\n  }, []);\n  \n  if (loading) {\n    return <span>Loading...</span>;\n  }\n  \n  return <div>Hello {data ? data.name : '--'}.</div>;\n};\n```\n\n# 创建纯action模型\n\n因为模型基于ts的语法，继承`NormalModal`和`RequestModel`的模型都需要实现**action()** | **getInitvalue()** | **onSuccess()** 方法。而纯action模型不需要reducer相关的信息，我已我们准备了另外两个类`NormalActionModel`和`RequestActionModel`。他们本质上是继承`NormalModal`和`RequestModel`，仅仅是屏蔽了reducer的相关信息。\n\n## 普通action\n```typescript jsx\nimport { NormalActionModel } from 'redux-model-ts';\n\ninterface Payload {\n  amount: number;\n}\n\nclass ChangeCounter extends NormalActionModel<Payload> {\n  action(amount: number) {\n    return this.createAction({\n      amount,\n    });\n  }\n}\n\nexport const changeCounter = new ChangeCounter();\n```\n\n## 异步请求action\n\n```typescript jsx\nimport { RequestActionModel } from 'redux-model-ts';\n\nclass UpdateProfile extends RequestActionModel {\n  action(userId: number) {\n    return this.put(`/api/profile/${userId}`, {\n      successText: '资料更新成功',\n    });\n  }\n}\n\nexport const updateProfile = new UpdateProfile();\n```\n# 副作用\n任何带有action的模型都可以产生副作用，同时任何模型都可以接收副作用\n\n```typescript\nimport { NormalModel } from 'redux-model-ts';\nimport { changeCounter } from 'ChangeCounter.ts';\n\ninterface Data {\n  amount: number;\n}\n\n// 你可以从ChangeCounter.ts中导入payload\ninterface ChangeCounterPayload {\n  amount: number;\n}\n\nclass Counter extends NormalModel<Data> {\n  \n  ...\n  \n  ...\n  \n  protected getEffects(): RM.Effects<Data> {\n    return [\n      {\n        when: changeCounter.getSuccessType(),\n        effect: (state, action: RM.NormalAction<ChangeCounterPayload>) => {\n          return {\n            ...state,\n            amount: action.payload.amount,\n          };\n        },\n      }\n    ];\n  }\n}\n```\n\n\n# 创建纯reducer模型\n```typescript\nimport { ReducerModel } from 'redux-model-ts';\n\ninterface Data {\n  [key: string]: any;\n}\n\nclass Collector extends ReducerModel<Data> {\n  protected getInitValue() {\n    return {};\n  }\n  \n  // 这种类只能接收副作用\n  // 因为自己不产生副作用，没有onSuccess方法\n  protected getEffects(): RM.Effects<Data> {\n    return [];\n  }\n}\n```\n\n# 数据混合\n在现实世界中，一个项目不可能只有hooks组件，有可能有stateless组件和class组件。而我们有两种数据类型挂载到redux，第一种是：`{ xxxData: xxx.createData() }`，第二种是：`{ ...yyy.hookRegister() }`。那么如何混用呢\n\n## 在class中使用\n```typescript jsx\nclass App extends PureComponent {\n  render() {\n    return null;\n  }\n}\n\nconst mapStateToProps = (state: RootState) => {\n  return {\n    // 如果是key-value形式，那么正常获取数据\n    x: state.xxxData,\n    // 如果是hookRegister形式，那么使用stateToData()方法获取数据\n    y: yyy.stateToData(state),\n  };\n};\n\nexport default connect(mapStateToProps)(App);\n```\n\n## 在hooks中使用\n```typescript jsx\nimport { useSelector } from 'react-redux';\n\nconst App: FunctionComponent = () => {\n  // 如果是key-value形式，那么借助useSelector()获取数据\n  // 当然了，你也可以直接通过connect()高阶组件注入到props\n  const x = useSelector((state: RootState) => state.xxxData);\n  // 如果是hookRegister形式，那么直接通过模型获取数据\n  const y = yyy.useData();\n  \n  return null;\n};\n\nexport default App;\n```\n","readmeFilename":"README.md","description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.0-rc.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-Q+2EIQZ2J4dlF/fif/nqF6tJbF0ZZOVW3kNUGyFZ7/uEjPazk8qc0C48ujjm8n82wByqHQ8qviv1HkekmgHLwg==","shasum":"083e5f24e26d151ed63d5281e3c267b5a036c214","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.0-rc.4.tgz","fileCount":13,"unpackedSize":47778,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIE9kCRA9TVsSAnZWagAA4UMQAIAD1A4pwDGyyBLE8WnA\nOJUWJZMan1nCQMG3Iq8eIsBOmPhBPx5HIFU334Nw7x0gLyoGBAsYNrupsd02\nS8KpjDX69sutk1tRxEviBG1P85PnWUcsthLhWbLaGsgpcplOQ3P74Ig+tC7z\nrJWPXXEEWuAJdNjwFK1PAEj8fXN0VNcyO08pPVfw9dpltA14YWFIan9Vrs+U\nwIaIYcvIqC5oPzkaL+6BWu7D2S/rVkbxwr2COzh2GGyzJb8zlfqS+guV5LS1\nAymb9gfBN77xG/TJrecmfBicIwV/G6p8o1IIMXS5UdGFqm4A1SD4Ks54g1+c\nbxxB01roCJ2Y93tFPwjf3j9WZbqnAVtm+WT65OCLz/HUI58Q7dRXhT6U0rTz\nTBpBUn0sY1Ldqk1HmijNMfk44Y1eJeR5qdFix287f902ZOTYhb+W2xAk1Gxr\nO5DAw/Y+HtU+wK6rM8IHsShTDYA+d2WQOs/x5Qoss/Gg7pvPk2o4HqRW7k++\nPD+CCmBA8axZkUbnqQojeumPd9vKOcBPoxJN+1Z/aJ9/Oh5kErPPnm4CAhUC\nP6gT2p8sNTcu3T+cr7RkhBd7Q19ZgTbQN4JBqBIPVZvMtkNcZHhejHWUaJC6\nI/n/jntI2JqmBsNX2ypwKhCdlG2tEwDRq5l/E+ePl/+QkeLGRRkz+IqM0iN+\n9p3i\r\n=VVYc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcbMx2JOX4VNVr7rJdtEbmguC8IsJ1dDxbIPExQFGSJwIge02cm+MKegZeY2gyporyruWtSvSxeDTOQbzVJGisXOg="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.0-rc.4_1562398563820_0.026345583864231692"},"_hasShrinkwrap":false},"3.0.0":{"name":"redux-model-ts","version":"3.0.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-1qIWJ0baCRBUHF7Lo99p4+hBWZtT+ycwe83U1C+UCjIi50ErkLL0efbH8JOdfNOVbVtBK9b002F4oiVDwbIPSg==","shasum":"290fbb576607aff16455b03a21287d3cc31fa02f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.0.tgz","fileCount":13,"unpackedSize":45237,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIF9JCRA9TVsSAnZWagAAtXoP/1RHkxYBYhMjCW9qYzy9\nuNj+TZRwdTwn20gXiT4Z8xQ0+8cUyunDo2Wy/jM8vLu8xGSpPnze27jYGW/1\n1yXsdwiclr2r5VY3fJu3r59ezvqf7F4JP2A7ieF1KY9W5sJiolVaSAn37RUn\n6V6Gt/AHmBVxprqvrxyJj4dA3VMIO2LZ5eLgdJTQtW4OMuE7vaE9SEniNrCZ\n0ztiZQZFRBs7bm+qaAKuuu3Nmtch6bI4ET4KXZ/NGZh6WkmAJ5ztP98AkpEZ\n+ybRapzN0vqgJQlCZOgLwlgIBcdlZI3OJgGJYUnvQqfPP2vsrSmNZR7iPlWb\noOKi1bJTAdQpuVfBfIiSG8RBv0CFjqeNiCNY6aa3IkrzEU7NLGLgn+t3WWQd\n00Egwhb11141KeSDL1L7K/keVhtWvsVT+FFf61VdCCjLwBD6oEFD9XBgWPuu\nNRtLoqQrmyg3uFj8Rr80gukEY1ijZKJrPqWkM2a/UX8iz9wDPXSExkp4nTA1\nKv7VCfm9jwwTh3uVWU++9fTfB4mUoQZWQXufdILO/zAcecBi2zSF68LNUU08\nhUHxVGRKHtYenOTGsfavJl4U2Vm3JYmncUIF1GvBXf8Jrsaleoel1xL9wa8K\nmmKAnjHjeyGlP04KQiZHzdiodW+I2+Lqzg76WEfZLGQ3d70fzZzykRQpgsiM\n0GYO\r\n=tNgl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgMcGmKJNeWCnVCBrMx5Eke0PJp9VHKMvvCaDmfRHa8AIhAJfpo+eu3wiTWscMtPgLy1W5c2uIuZOXy6u1CNKUXJR2"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.0_1562402633183_0.14718663016207678"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.0.1":{"name":"redux-model-ts","version":"3.0.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-tXOOfY2fy02ZYjR9IMHmQSngpdw/ZUApl3XUUBI4BFjoDRd9AdCQXG5SpoBrO0x1BKZ7Cm6AWl1m6FZjknkx7Q==","shasum":"10c0205605bddbb6b444f6405547903ea00de51f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.1.tgz","fileCount":13,"unpackedSize":43610,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIGs5CRA9TVsSAnZWagAASgAP/R9s3m18GYCqDfAW4LXI\ni3SQn1AuSm1/cyOmxoJgw5I5rJ/10Rm9wrJGZy4FUr3kI5TwIesSdax31Dve\nOu8lY9qzKnu4nIXOSxTVW6hPb089rrR6gDnNwIWY2wRtS2bu9ZRwGcqCjDzM\nJAmS0DnFfqdRfR/3Ww63OAryXRCEzGZbvJOEY+V4KfY2jBpbYy24QYO+Z34p\n+vcHt/+T6qNplJb9YX8Q7Rhy7wQvexaJdBqc0dyAtiqzSWcyMQne+RSkvFZ2\nFpPb+5KSlC6htCs2v4VRz9iVa4Dq972J/QS/UeY4bSOBoKl+BAdN8HUS/fxk\nPRunBZKZhKUl3pym8Y2wfzkAhMYXdUQYYoFx6n+U0aDWIRys5Hojzo2YKe9H\nlFDz+V3OAxKgIiFlMq6PtRxnkTUfycjU96wvURmfGfgYPLR9F0RK8+kOZCaM\ni0T3PypoewuMAllmbV3otTds2oHIFf4zwDLTAzGk2PsNVt9iChdgpzRcAz5i\n9Io7lPRIFtg2jIQWgjKylQFI0Yy1vJzwVtjpi5Kr+zICinHwYM+ApO5tewQ4\nrABknD9Dwn/hnUNBtGaqnmn15WxUqlzQaVnSyJlbq2Hlt5f3hgLZro6sjhSF\nQQGjqavtH4CGjVUrVpQmfCaLDtXzKY/iwJDghrVCze0YUnKaAitRjU6CgEcW\nUrPG\r\n=V05U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZk5hU2tTzOG/ElGkZ2vef/fo/dEqRAND3QhSpP9CjIwIhAKP9bvj305uVRzeMJbo6iC134YS0AmfIg93XU1+ZWcF2"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.1_1562405687806_0.4319914847343558"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.0.2":{"name":"redux-model-ts","version":"3.0.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","typescript":"^3.5.2"},"description":"使用类模型代替redux的传统函数式写法。可节省一半的代码和时间，后期维护超级方便。我认为这是一款准时下班的神器。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.0.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-X8NfYk0n6UspvnhOqHUT9aWcTXkwzTz86q1PvwK2Oq1xHvES9qpw1K5PS3uWMnj4R0GIBfMOZiCyBQrPNgmeHg==","shasum":"d61eb6e8ee175be81a06e1d2aa7941800e6e077e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.0.2.tgz","fileCount":13,"unpackedSize":38208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIJc8CRA9TVsSAnZWagAAWH4QAJgNu4ngpgNWY8g6Uck6\n/zyZJof8LIpAv1amrSpsv94lQm+Cjte4TEkY1wBeU51pP/O95iZ43pz6Z5FT\n+zAbmPJoAFOqCY/C7hoVA8ByJoQn5L0C1BIMQVwkaAySKAyVcF++jC1dW4OA\nEuiV1LiuA2E6NdIHexWtYRZ6jW3ySIyUI5+iI2dDxknd+pamtiBamGH0wrBS\nAiDrPg279sicmQcxYMvIHxJD/1kVyKpsLW2Gxn/JUbdWSwL6wtoy5uFTAb+Y\n2SnDuMtoNvHJlumiVUy1OmoKHnvqzFGXU8WRdo/0gTMBMKN3/qnkyObFgw21\nAz1s1D64a1rIYjDzqQNIxynOMEWeKCiQlqt50rrqa7/tOXpWLzlYeTMDXtqF\n3p5OHeMbzcTf9CJsz45ehXe1KTs+nhR5LVVj3jcoRR/ZaH6jS8ZwvpM4qQvQ\n9d/ZSfvF7//6FZqD4njct2I/QsD7FPtjTT1Fg80JYFTsPMYMXAPeNlv2ThvO\nic+U7NMt6y+FZdN3LQQHFFS8ukZEyGaTaokqexFZmsL7W2pxX12nbNK2HlSO\nAD6Enz4H/f60HSf/cGzBIzjeDPbJ3Ikyw7c3gEMyq4K0NIA6nVr2JvYBE0Mi\nu4O1bIz7YpTxsQFCveFJe8GWoIjviIrVQqDoh5ew6mqA1WYqP2PUqcfpUFwM\nXVTv\r\n=aBLi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJGAcZ7lhXoz4u0ghYIumOnHA1QOP6qttjkHJrvjbX3QIgGiuWlJR/J6WTElI2pscBrWRhT58z2jP5bBpEdn+/TAY="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.0.2_1562416955677_0.37931910831154725"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.1.0":{"name":"redux-model-ts","version":"3.1.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"如果你还在用函数式写法去写redux的action、types、reducer，那么你有必要往下看。这个框架对redux进行了一次彻头彻尾的面向对象封装，让你用最少的代码做最多的事情。","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-cfimjHpY6+DGr2bu0QaorsHzW8yn8sWYdeQOboKLSOjON32/BwddBY8UXW1DJ4wVuNp9dvUS3NhFBDfV8wwzjw==","shasum":"3b0482263362f28f9a4518db75f5ab14078b23ee","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.1.0.tgz","fileCount":13,"unpackedSize":38776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIVvoCRA9TVsSAnZWagAAKtAQAILEe81ZW5IdU5hEWBSd\nz+GvZtelfxB87ZhjS6O2xDOk0kq/knwISCqaZfBAQFvKaAGd7PxcT4yUfeHN\nQc2Yl/Iiqef6zEe/l0IMbkPhug9ncwKPD1/jJw5d6XFgp1+5AFUmIANZ9mcG\ndLkkeXEWkJnQD0AOrSrKi2spCCiLYKj69lFIbDrOrSrmLhWlOn8Of2XwBvqM\nCHB/wLeTVAq7vA/01iObvzvrxtbHSeCOpnlNXYL18ILOd4I9+yTS5vP2FPWc\nYIXzL3N/qRpmVevgOYj1lTFq2wGZZWsfjgI7DavpQKhndXFwo7o2e1OCRVVt\nDRnWGxWXkp3AM2uzPZgrn/Spg+d4b5jeZWpqzTAKWGKj/ImSkJuhLq7eENow\nsg/7LIDCJYQAMUPW+bHOUs/dpgFgPdFo+hCiPYDN6wbmLV7DL5xBKNhy2lE8\njqRpVPOqCdDEWwNtpRUB/blVC0xN0CjJjtYH3vZn56kSWYTa1gPrUDNfwdag\nVrwfsiluybzNeHO2t/s7EZmlRQoul7FPMq8/9w4M7T/gokmlMusTiVlsEd7u\npq4QIANLqU3U8taQcWkf9FnG9jGqxeiLTjZsJ6DNS7ZMy3qbiTCWEfZn6pog\na9EW6XW5TNc0XePTJlnlH4hMOy2vPXK6+oSNq/HHa3aSoWYXQMp5D5nCejXB\nLIvM\r\n=wE7i\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFou6Mss90X1Q74xQpXW/4cizSqrjRwSmgmP/Cp2zL36AiBQD7dTVJO+A9ZWViIJvWormjnR8uL1tPRxZTNR/fxjig=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.1.0_1562467304308_0.48777810479600836"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.1.1":{"name":"redux-model-ts","version":"3.1.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.1.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-NXYY5TinWzGkQ53pX5dSUQqzxEaK5/xNxdRa2L8viZYoCpMVxAu7eDUYuZrZNebryHLtNKVGQ09Ie2rKMmvmQA==","shasum":"8ea4ef3eee6c22ee1028e2eb07677c02930c2927","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.1.1.tgz","fileCount":13,"unpackedSize":37565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIaxcCRA9TVsSAnZWagAArfQQAJ1cWTDwsoMIzPJU+4pp\nhNHYZEN5UaNEShoe3As131lTkClVC+ksn/8x0H18NV/ijh09V+zkv4UTGXE+\nDM55VZ1kYv7cH2YxtCyGVwGHJkNaSHvOBwBSsIBOqhOWr5lLpCGPcwieYL1u\nCqpCbbSjojHMEoZ44OsukkrgS7tjes2DCCMXEwbju+pQ94Vidg9PWoCXEBwa\nOernlbYP9tZ+yMii/l/KzFHYNIBAmt18KUUDwbUvWS0LQsvr5QDo4oLNBQgG\n6/NqH4jWwiwvlOfaNPZ5LD3SdIe65ojVJiv+Fn1GaBrqcPcQdjjYXLYdSEmC\nEgGvewJUgpUBLiYHLmhTee+U+vLFXqOZHAj6LG1hlAfsEphIELkI5EroW4GY\n/XHfC6KCt/aT/sqcDx0rLN5xieneN9EKmMYpiZAOvqGG+6D1NR29Czp3o077\n//Vohw5+dfLX0fsWffbgz+dmyJlPSCFHS1cNfa+R65ADZ95AWEhYI4KF4O1q\nfD0zKlIe+ezonjKjpK0r5jNtzeFQJJKdkldepzx8HK4FqgRK5DoqzXAlz/l+\n/NrF/bO5nKcNhzWsJ+w45e1bnMnoZSynYM2JAj5bimhFZkiS8lUFF8QXJvj8\n4glHLyKefhzRxR6N8u0IykX8ClK65ZpVu7OKHUpuq3gGxCv1ycjKHKWslzPR\nbulD\r\n=VfFP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCu7qF9y+gHXVE44Qb2QicvTpGL7RrUxzhqJrBhOJoVAiBgIlJX4X3lZIZi0HqnkDj0CWT6uL7FSR3heCSV1ETYzg=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.1.1_1562487900016_0.308994986536284"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.0":{"name":"redux-model-ts","version":"3.2.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-5YfX6PapDy64DQ56h1fYa14vo7qNORlPvLQ6mWX4tQ7/lamwvcMltIa1w1sTyrE1sqg04g63FVeLf005ElIvTg==","shasum":"c51eae7c207ee0c50a2105b0ca855625ea9b9969","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.0.tgz","fileCount":13,"unpackedSize":39238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIhqrCRA9TVsSAnZWagAAAJkP+QCcr1HdqSvdM3VL8XvF\npnt93dMKWxZJYOx0T5MVhZgTm9BK7kUMK8qau0h4XCi9pZu61iocwu9eTmsU\nVambhI+IL9t0um7d6lOfNkvrPJ2BYQFfgihELl1iGIO7nyKsnoPxHednDmpm\n3wGvJg6+SjtEbymhOJRYdiQqXA3oC1wRpvzg62ANcbz7BkaN5kFm4UrcsB1N\nv69tnWn9wFh+RgeabL4T4Zd/e5DDaGs7g1jr1IX/jNmy5t2pNu9RFaqbR+iH\nXz1bG45XAA9B3hY5z5SgiEVoYa6m5oos6zuqkOLGG2IKwKmqkjPtCTOlB1xt\nNOA7WTs3JC2pc5HozZNX5knnjVLvfT3iXyIKoMo+mJ+TflsLl0KXYTg+2IS0\nuGZzIJL/XajtGEh8EZtVSCd6OLOXXNvAMqBjvzN+z+oSfHjOLOK+ZYFCV2FM\nASIuUSVWrX+8lZFHbqB4UnBTouQiiPi8G9UMUjbuVNbB6s5+tkQgf1Sk02dM\nohYGsXFP6Q+i/4xLTHqZEJ7sdab0+TSvoe3TS5skpxHbhYjGzjyaxK7cPBex\nKXaM410WqAvsjPprJctmlKdOGSLXGwvGGe2n8UpxOBGgo0OO1QAh9msnyZwe\nPU8jQkciGwvWx/f4F+1Lc29HfoRAp6Ka1jn7EJkvGI8qYuz38zq5VKUiT2Px\nEWd8\r\n=X0Yd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDkCsSlpfyYRBBdr33kypr09dPKj3F/VoMu6iatPP46AAIgc7hceZyUI/v0Kw5+oh8gPUDjP9tjH9sYxYWkya6+pJA="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.0_1562516138298_0.7722226027305581"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.1":{"name":"redux-model-ts","version":"3.2.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-EJfKqpDyzaaRybJ1wmcCcD39hFB2zNirGmmv3bmosYnb5p0enQee7nMLdL/opwC4AuzHzk3OzcIK697mTygYKg==","shasum":"44d6625a9066d2ebca61d127a068932817ddb731","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.1.tgz","fileCount":13,"unpackedSize":39303,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIhukCRA9TVsSAnZWagAA7pcQAKTpvoW+5gHcKkFm8W55\ndVvRdJXiMk1u7R/cI95ZCQJNXkbOP5jj4weP05otSv7lV54cvsPzNwwTISRj\noV4Zpzj8Z7mnFbdHRZGXDhHxaGQ72vJ+EV04odfmfXYvIic/96XgJvy+Hz6L\nxYEbbAk4e7OyLQwRUXm83YyRifLYYENCKD8Kq6+eUCUpNCVq/Psa1uBThZVu\njOp0oAmFEeBUULuCRqcPkWesGlpZq1aZ8phipFDwaDnxIelvu+igcREXfLV7\nhm7nVrXZrCyUbWZ/H9T98inmUXjmCgi3KhvYtgCXZXYWA37uqdkuri3pt3Rg\nmVzOyGq8bwGxvJZ6TOHjH5W9X9IgDjtFJd5orU8Av/zVHjI4AHPD6GOUCpqa\nVU9HjLmpqD9JVdt2TzpNN5cPYvwDn7rWGEpBto1pJYWVmv4Br1YBMjTniUxD\nUVheSnyWXkgD9Td1rYKFg7vGLDtVC7PenND3ItEPSuIf4VvyyOEWQMJ0uEBr\nSPzFHUQU1mGcALsY/843lNBLVEQ1r5a7MeGwTUY/zdTMY9lwazWMTLAPAJoR\ndoRwj3hSlsRqh0cJdKZj4A+uFu0El75D29GLB91mZCBYB0cuzbM6Lk8mQcpy\n0rpXi6ZtVBAbm7WolgBEQwgc8b6I1SJcpQUnqwpvpPwBusSPluZHZpNKKdgM\nYf1O\r\n=mnJe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgl3Ulesi23CEpBTLs88IyqNYWe8ONwhd0mFaDWWFCyAiBl2C8A5KjZhzLVSBs8x8WuNVtoJ3asvr8IHn+NXwDFJw=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.1_1562516387416_0.02895742520131228"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.2":{"name":"redux-model-ts","version":"3.2.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-4c49+ltU3gqoCOpwc1QmAlIuftNuI7dCunc++yOvSl6lnrKHdDdazExHsotvKeDFnmAaPk3FCE5D08UQjBBALA==","shasum":"798a88fd7d010dcbd8b0c1a3faff228b2b18f96c","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.2.tgz","fileCount":13,"unpackedSize":39212,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIh4PCRA9TVsSAnZWagAA/0UP+QC03mnKcADhVHv5sU43\n3N16GlN8YUnY/MZIWy5zCrLzB8ov7sLsF/TQGhwDPlcbXeD1ziwdmGaJNZZX\ngDZXsbTSv9XAwkN7Y9uEG7PfEy9kqfC6tachxI3ERWoclunqOQ9jt9E2WuJY\nXCAXOpk7pMaZ+XRzFQ05XGIfedt1v9wdHvvSvJFHz5kQ7PLFUz4sSOk94arj\nOWzBhwvXM9J+pVgdnKYgANtdlMFggHYn8gz+GDpQnAScLy3Dyfgb8x2YkIL5\nZ/lFRaVEH2C+yu+fIOWBpwUgxr32+Q9V9i79Win8kZDJpEdyXnZyE+/ct3sV\nV+UPNhNFHIhYZvV0wXF+gWl8vU24TuQkmSThLxWImANUAcj9SCXtl3j1gndo\nrB/rZsLXQIRb9S5baPr+p0mvHwJ2jw49k5GO1u8Y6CW2RMaKZo3eP7trGL6s\n+hE1WuU6FzbppUiwAvElR9mostIS3TbvHa7LABCNoLuhNzEEPETrMJPHuTBM\nwtR/vvoAxFI0RONC/2Tfr+D528w08xr/bFTh75ZBt908Nfk171p596iYXK2v\nz6nd/+WphT+KOwY858G0riU8uTCePhb8hJSkVPB9BUk+j6pJ1WMkhYw5/S3h\nfEmYOg3NzeGZp/HDwcpuenZ2JPWVZBmdTgh3L7NS26EG3OevrVHAKgrKWb1G\n3Bp1\r\n=3MvP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGufUHp+mQBgJpRrfwO8jNiMoHrfvvzd32WQ239DKXEwIhAKCTfDI/wJQdwGebcA46+7KeurMMIa3NpOngO0FOqmAX"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.2_1562517007072_0.8269376803493891"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.3":{"name":"redux-model-ts","version":"3.2.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-iDZEe7MkNdc5vTnzQPEvk5VZ/paI4RYwVyi0+QPah5a3PN+VXI27jyetGvu+vvJUgUQt3Gx5dmZHVm1q8e5lag==","shasum":"0dc7eebf1130c9a348c114f37d3cc9a71f54e7e8","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.3.tgz","fileCount":13,"unpackedSize":39668,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIo9mCRA9TVsSAnZWagAAmZIP/A+Ork4pUPGy15uPoVGf\naGi7EmwkpvWlfCvPi2fhkqt/Ex1777PgorSKNZrye5Hak3hJLsGddqJ1Rb4H\nipZkdcPZFIRqfoITeAJ8xnqU+BCPF6DMAeT48SQTlK/ryog2mrxBAVQ7mh4+\n35vy1sszq04RaWeG8v/icAoDayz6CbvedD4T0ar2bRwmSYNh8RtdRj/tvE4M\naXkhjVVSJH4RvVhdI20trymvi7xy2nZa+Uuy73cwCbqwDfjpgETC1gwrj+x3\nH7hliwIpn1b2z1ivZogXFUTvU89+SNK16XaTRNkleomeQLsvAHzLPsCpzHGC\nT369Tw5M0ntiYPvxTW6lxBOsF4v4z5B+Ly1iWIE64xDm1m7Hvgb7oWrdl/aw\nBzIuo+JVdKEXXn+fxKd7LE37ZIjm0WTl2ePBVUwq7vcbIOZE6NNdxYdf1k13\n2OUjOzbL22D08Q1z7+wfk6Sce9LqlXSfhVyzxgtr3SLoOKkZpvf3SHu4sDo0\ntiNpx4SHHzbmECtMWpcM0Qguofv/6AVvNUBSlE118BUik7EnKK6fFvNaHQ5f\nOh6Ov5cLAbqsRmIHlM8cBLUOjLH5IUxSyb+kZ9duWef8yzvDppjyukpUp77q\nP/lg/lsKDIB2K3iTbG4a7/Sj99GZz8oEV7PRPfb5yZuCBahy/VA8Svb5qRr8\nnDJm\r\n=Rh6C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ5R3ptsIVJIv63hYgMZU+amDamuFgq/RIOXtPGzoDZQIhAOZV0s/HfSpYKVQB/YyPqBD3ovTGx8ZOgy7WXjZpC91S"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.3_1562546022371_0.18187198290780904"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.4":{"name":"redux-model-ts","version":"3.2.4","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-1BF3QNm2E/BILldY3E1KW8xSBac1IfWonXqMjCz/yFKoQ+JDIwISo4ovy30TqWUyQI45pdYEEMpXVxQhzlHsZw==","shasum":"ff05228db8c30560a4ff94b8385bdad085086ba3","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.4.tgz","fileCount":13,"unpackedSize":39601,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIpLDCRA9TVsSAnZWagAAt9gP/iXL0WOHKeDnJAWeMxUZ\nAZrt37xfIFAu+WMace6VZRLZtBz32+dL9tatYeNx3SwEu2gAhJMr2/SMUjzU\noBZ7eETugqym2w8GvCbowaS62Ls3CqRs6LdbDy0y2OSDO0sqRI6QLZDNMVeo\n4FN2osNUE5RU5oqot2JdZSa+qHEG7hm9IH6WuZX0CwPniNyXUfXGdyfjQBTx\nj2Dh6gx3I9C8gN1GmM7YfGuUn6EkELoyJYbGYgFPlIMGJzBPScBxrhUv7hkh\n62o1j4D/TXNSX6LbhuYvHZKX/353wDYMpdsrY1RWPBCsyBfNn6HKgI9IaEIB\nUWOvaPM5oT974bz+QoaDR+fPJxQj731zaABKNGXigXSbGsFEDFNoqbKxwj7w\n+bw7To/4J6dtls14Ps6FyO3l9J+0Z2iXmJUn6pPFGMCsbZ4Y6YIrl6o4oIe+\n8tafQzx7wWnE7o4V4YERsCFh4QD4Yej/pL5eUWrIrMENC0JbaZ5CGJuqc6py\nCAnzpU4POB/j/JmRMs0cDCMPVLoInfkzKp/2PMou1XOQFaYT8LjrxZL8s4LV\nZ8AVgRgkvJ5O76DOTjoNw064/AjItwtvFRrQ7HxmDqlFj+PnJlaIzZ9zxGG5\nTaGIkCJdxcosHBrZk/BgI9fQRSpyBdvhUCQsIEBReq6xwgXFwID2IYh9i/ty\n7qOr\r\n=2KFY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDAJTT6lM2Vubhhr5d/X6aAxlgTzqC0k4hVRY6hxtTZUAiEA7gdLSBNR2KNWW/x/aKKz48sVYdiKh43Vll0YQxP47IM="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.4_1562546882882_0.14551958935270592"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.5":{"name":"redux-model-ts","version":"3.2.5","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.5","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-3P/Lm++aFwcrQgb9uQw5ir2Rv+vDeb9smA0w/LvVblw53qKzQHnYFDrwF0Xq/Tob3myfFesaM+E6ETnjgSarhw==","shasum":"912cfede489005c1f6f69d1499b758aa403ef501","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.5.tgz","fileCount":13,"unpackedSize":39602,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIrq0CRA9TVsSAnZWagAAfsgP/2uJC8Y6veZJckqgCMgO\nCjhMF4KCOY72tOghm39RBIq2mJLGlhZjYmW9I2jRxP/yof9ustkQC9XL+nVP\nXpolsljol1WJbAkD3Iv6d6fEmqFn/Iaos//7BxWiIH9wf514bOneo4Dd8oBJ\nUSXjTp39aogcqHsrczMSrFE+tPnz9J4sJNJm2SXWp6GL20W23NSl6LT/EBvO\nM1/aOewi/jfVVaPUTxAKFDL1Bgn002aVybLhW8pvdB9snv5qvl1qxlu9WNdQ\nAvuEQZITvRhXaHEeb7Sw06D34Mk9q5qOpMeGYhS+/rR3gfui+yHk40IDa557\nrkXUDER4UmtoZJk1XSv21/SPj9Mjwr90Sm/wBuXjljBZsOujriEMTzWF0VWL\nCmiZie9PM7cx+kcIOP5pbdNJvQrpKIKriGg5CwBCaG13zt+8b++gYUPVI2A2\nEvT4LzhBMOchNz+mgVs21RJuDdZaBVxyr5N3dr7QtPBMHUJdTyEkJ+aOnErH\n8zBNnnGpoLIo/0Vp/FSsdzxUPti8GQzghVp2UT+5wMzCA0YrAr0TQl+f14d9\nT86zKz/ocuxANBcz46wCnoACe0TBKp3y6UeFDSLEAGW3KkaZyK0JrHTXSpdb\nubO2hvM/HUyE8lI1lKx5f9KJ3ai2gjptQNfRWt94j9QXwejUGM3R8WnmAmR8\n2dQt\r\n=8Hkn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDd6bk6gruwntwE93wjbGCcbwFDRz3UabfV91LX3yNcSAiEAmKgaDYRBEpk1YgwP6Ay4lF7KaaQas1yQVR7MiYVBcfk="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.5_1562557108194_0.2904005789702324"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.6":{"name":"redux-model-ts","version":"3.2.6","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.6","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Za5jJY0ViqXcS69+Qz2BC1uoKqu9slJQcGr3/mc1ukHoLIQRh2i866Jy6GbAWDl2a3KlArXn5TzhB4Z9Jr1Nkg==","shasum":"e7fa5f93cf1f08287f5e55b7f8d82240a64a60b0","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.6.tgz","fileCount":13,"unpackedSize":37351,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdItKlCRA9TVsSAnZWagAARKgP/1ioTMt3l21zcaS4efx0\nO6teZ7iIUm7lVG6GT6b+jJ2Zm9m7Ii41TouE7pcnHMSsoraFuoHXtQFn1LrP\nv0AihTfBL02vcOGTBpYvQ+7XygfMxjX6KG2XtMe/clwMp9H3YlcqPiPieSiA\nJNuyvWYzjTM+ujamOCTi7BA+W3ftrow+Xxg/H1U8Wsny/atM5VhmM1xrUR+d\nsPS0jKmZYsFiKdwPEO6uWQiTMJszwD5sZL0dLu5jUH8cBTUOR98qnW4E7tTA\nlFG2RneApUGxxcMCYXJrURXL83z1aKOPh01HlEGdWYSxE78ksCfgL1JaEGmn\nZqQrtHp0t0YeP77zLRtWjrL0M9y4uHOmHGKUqWAsIAXovGTwTfg/Y4O5Mjuh\nL9l9oPg2prjXpDdn9auIxxZZ2zfwuR8RinlpeN0752emjY2rpB2kiqy8Pcds\n/0WPYm8And2u94+4y+bGGW2FYEMUiY6z92SvhWt0WklbGnX6TWOFnN2Xdbni\n2/QOb9jK3KAZhWgEk0S9wlHLYMhiOu+5J7Oc/rDYymgX77V1L7bfsukVI/1R\nOshY2Nc40l15BwXxFUbLgHNCiTlNBkVOF+D5odX6jPp2L30d41dYPeuDIV/j\nFTvikF9j7tCagwGrbtdj4PPt8Y1HrSn/k3Y91k3NzVsHpsIFQxpIg2VjxHXd\nv0sh\r\n=CUqA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhDXhQcZia/0D0PffQeEnDaZ8d3TP7DC1L7xSHJwMUjQIhAIm7VjnZzDI0cmywaUrMbYuzWJ1rDK+xJerCvFRY7q2f"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.6_1562563236810_0.023212389957286028"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.2.7-rc.0":{"name":"redux-model-ts","version":"3.2.7-rc.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.7-rc.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0OBYD938BVAf0lQB2te0OiAEK3/P6Q4QCZRQC3HS5IF79Ta/IHoeKelJqOMvbaZrdsUGz6R8dP1cDC4YLDFZJg==","shasum":"2dd02a329540e7f6ea9e704436e1b75867891bb4","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.7-rc.0.tgz","fileCount":13,"unpackedSize":37682,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIv0BCRA9TVsSAnZWagAA0f8P/0XkMzqCTn6yw4wLOYYi\nMWhWL1Yb1EmRuwZ3sYi2cZUGdbj5a7GfsE/oSsTJqLxDiDrywlYpXqDUDn3C\nkgAQtW2wHDmE/Lx5mFUw4GS+iFIcjVxYcx2ae5s9KEDF91RYISBgHz4bQJYy\nJeh9CYxuIKOBncBt+LX2BKaXWPKDoAM3fdgO70J1ChAYUHvOPwrffxzYYb4I\nYJUOT7LWKylpPp6KLqv0aA0gdaUqTbYpqFvLsEIKqnNq/UkjNyXfA2L3BEid\nUpbo4MaXvlpYwWOq7kwp8YB7aXfIhQ2dWNXKQ+d/WvM9DUEpGPvWUQNIIrN4\nvLBp76vi9QHQUMyumiA6dqkZQA772kRykUi91zptti1CSSYH6G3fifs+x9JH\ny8KNzX1barVlgt5HyUs+6x9EHLFXWtXsI60LgXIXf1RfB53u9DZDBSMR3gjt\nz1mU2LGRaSRip5FPgE+sZFMwFkS67PUpVJktzNv/+1nuqu9Ga77HU9iZglpO\nrzK8OsPk1Id/n5E/fOIB2tE31FZBdsbN+Kku4u+9c+uZAwlcJ+/WowR1/1t+\nxmIbjDbDmtS9JtzX97s8I6u5hO/UUPWLLu0mXst7v9OvIcE8Q3uPY8UP+cDq\nCdzEBVJhkcDWRBLrXb9zwc4zWTkvBscg1Ev3L4ewcruyQzIlmiM7GgAcfV5b\n+diE\r\n=dtBU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICbt/junVg2BUHi/SkjiaMQTRijdarKLqzOyz5anqA1bAiEAm2q+J9dO7rlnucFIWGZJgofPWWL1ioksvXTJQqz7gS4="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.7-rc.0_1562574080980_0.38755411616149593"},"_hasShrinkwrap":false},"3.2.7-rc.1":{"name":"redux-model-ts","version":"3.2.7-rc.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.7-rc.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-9sroCQLy6hmt+/KBLhbEnBlVncOY3GCJ7JzCU/Ac/bnix6qXgeX9WPLvUzEoEjO13HKcDxTjc1AGotvUqN2sbA==","shasum":"94fb50479a7512d82617331a183bb9d1daee6dba","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.7-rc.1.tgz","fileCount":13,"unpackedSize":37828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIxpHCRA9TVsSAnZWagAAp3UP/A98Ib3wSvgxx3pRw2Z/\nvDoC2xm/pNGWeF1hGnaoW+F/z9+uin1tGvDkhQCEAEirtKy6CfyJ9cS/1p2t\naCOVnfqNsDr+VSnlru4hiJCFjNQOhGkDkR6S6kB48LhH45tHLA80dJpgctaq\nmP4nj0gJsBa4IaYWg6llCylDkL2EIH/GNmrYjI7Poio2UoRgMMyTMdF+w1ua\nLp0EYfunZey1Ym7Zqnh1hn+1DMDcaZfxDmcT6S6JGkwSRnTMeJcaOWV7Bidc\nrnug/dUtNn7YvN/yxlHwal5Hr7HpxSBjbYNcsE8a6sewBcAahw5IFQp5Mvyy\nANUNdRxDxiJcoMjtscZqXSgnbn87DGpU2eKlXSdubkAxgEKKHcioclJO31l9\nQYJ2hHXqjMK3TXt8SPh7cRoUUs/v/uFulFsh1BIqhm1Q/b7IebofForQzF45\nRgEgwYWmTPVkBlQPTyDPnHlAps4W15ZiRSaDHe7G/JsrMv8jnic3ODFlwO61\nc360ToSraUv2nvk0nGgwy9TzBCnDVz0bHTnM9JU8uREwN8o4BpOaNgytldgA\n7F5pFwMxUQac676SBpHBk7L80memqgY+1LNO+GxPiimaY6Dtbri+oH35t5p9\nvVMFQoVNWk1rWOJ1SjujJ+EyBXrqi7dWRDfgoeyCye4Htgf41VA3ETCgYU1l\n7LhA\r\n=5hTz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDt9b6lK80LBM6tJe8v/whisc+gDai7eqtZwg20SNvi9gIhAP9Mes5XlsM9xiT88rx1pKm0fHe8ZPpnOWK9RAZljeXE"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.7-rc.1_1562581575125_0.34783300532853456"},"_hasShrinkwrap":false},"3.2.7-rc.2":{"name":"redux-model-ts","version":"3.2.7-rc.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.7-rc.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-eYjc5AxJRDT+fP/fzy8Q7yHQlI4AdLlQWCmdIvZkqqt0FUPltw5TmRpv/IcgUJQNKWoROukbWbzVZgN8AlUFYQ==","shasum":"318f3ae0b2a17524fef226affd7793adff8c4978","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.7-rc.2.tgz","fileCount":13,"unpackedSize":37364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIzMOCRA9TVsSAnZWagAAeRUP/ikEFY7fwIfmnCrl/jLM\nnbR93rmg9oHVqjFpmlH4kkugMBjwtwG4RRqA3H6O5XSIluG0X0EoMZ4yk1zt\nSSB0ZndJJ4uLYysJ1f8UwrIj3E12zPDH386MUcOvuRVpwJXl6prN+KAdRzfe\nfLZCFTfpEbl/4+Ya3dLUdhJkSUU1RPsafyaX2HwicScrMVHN7tTjrofEsK08\nakYulFCCeaj/3f3xiOu9AwLmDUPPDcNZPVCrgIM/DPCsIYRV0XcFz+quSZHT\nw/zdCJS6QXl1aR76sdGGeLuymOhaiBVgasDBteyXAPR99XnuMhqZnk3PiuC8\nBJnJ/xVgjVMTYvVAmjLwxRfX4BWmdgQbUI+isZDofMk50ia/hT6jKXdLixxo\n1TPq342OktpwUCyk3PKXwkstz3pSgBnQddV9Gan+MsyxkTPw6zsEnEeWqJQV\n1dxX9SFs/3dU9aDgv3frQPbLuDCfg2/pJR8eLBA/nvok+hT/6Abb0csXqte3\nICqsQ1JrM63eTdW+LBg7hRxuNpb9imS1/pt+u5nLcSICKWKErlfhT+t5gRAZ\nN4krOgJHgWfz1XH9NKCxHz0WmXcXqCq1tAb3ac6MkxQFxFu9vOXJH/GJU+2X\nr/uCQ1lkP/OCrOAMy08tcv8XRqiQSD9ny+wijLjJHsUeQCTWYUbVeIugzeV9\no5vL\r\n=IZtc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIACAnbqYEJCyH/KGPlUlC0QuUL2ApZ7sG12VLIw0iwZVAiEAl0jL6/flTypcC9Vb+/ZRbDrRUHFYEyyAPqJdb4MbbyY="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.7-rc.2_1562587918395_0.6648000784321593"},"_hasShrinkwrap":false},"3.2.7-rc.3":{"name":"redux-model-ts","version":"3.2.7-rc.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.2.7-rc.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-O0rKCCJdJ+8dEe92rRVdfSmU4OB7khDR3Bqvnjme392rlSK3A1iYdwdlU3YNyZp1g68fydr/ywZedaCJOHx5Ng==","shasum":"992a636cb3344fe88534618c38e31bf40fc56fc9","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.2.7-rc.3.tgz","fileCount":13,"unpackedSize":39623,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIz1/CRA9TVsSAnZWagAAFz0P/1fTyRjcLEBc1ZYI2WNL\n82VwOH+ux/JDvff3ej73CyMMKP78O/CrIRnWfuSyP+OW/BNpFUro2CKYr9ni\nO/jm9rtDywFnh+LQn6R2ufJL7Zod6fpK9h0giM87Gs74tYEvzqeveUwOoDjA\neC1HrId57svp6knoy+BVx9V4T8Duwlpv1gQ4de5uVrZfdX14LEylzzlBsAKt\n5rAFFTgLW//r6EmyUWWv9NDZm7uEJtDlUnx3+estSqTfeX0yErlJdBTH3SK0\nxV+Ltrw/vaAz+sdj1KB6nM/i9gWEsWvH1iv7OSCPx2V1fh52w2xRVSzLm2fv\ndQO/sri0yzZvabAgL99MrLE2ICuDPP9tlBq+GeYea6QcsStGuuBYcHxH1IX9\nRTTL/JA40aQcUzN8c1XPfDnxHVlIpWC8jDjgtmJpNqI+J3mvkkGzxxcOU9KH\nyQaxLVxFA6DtAaY5grCVpfZrvlQh1LEBI/4u2zXtFTJi6yAO+bsJWnJs8Lll\nQHe0k/eLntt/9MuUVqsG0+C2/bGy7HlP7uwz37R6Yb/bapxIeuc5TiiS4Zj1\nPVeDInp5/8JAzL1gqGDqbao6tlUnMF6FGo8Ld3FCX2yvaCs6toazBLKHo1Ps\nsLG4r50K0hRNNZgsQolzpjLqwYevQCMJV+4WtdBt5bVhadNYiRKV7dUgW46I\nimRG\r\n=bnHo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlB/9KJqSgfmQyTgATSbyUtlk38tCqb0AmgfGz6F3rSwIgPlcgOhULmijZjnFG25ECGoOQTIerQ6JCMo2TOXh2wRU="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.2.7-rc.3_1562590590837_0.6454931499864862"},"_hasShrinkwrap":false},"3.3.0":{"name":"redux-model-ts","version":"3.3.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.0.0","@types/react-redux":"^7.1.0","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.1","redux-thunk":"^2.3.0","typescript":"^3.5.2"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.3.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-aCuSW/ToMH9Csm5eMzxPoLIzVkI6DUlvIFjKPi3dtvy0LJi0yqRB2e4asUHufDIVzmyMLvVTcoi/ITAp1pKcLQ==","shasum":"77690effb9a8e467c0757b16dc3531430742f085","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.3.0.tgz","fileCount":13,"unpackedSize":39618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdIz6BCRA9TVsSAnZWagAA/skQAJB2NsN4sDX8IbUYRJu+\nNHrlVP940+ObfS0HkFrPcwzu+rFjVsfZfBQQy1l6Jd2nXr0zVwoA0K19m8IY\nbLzEplYYSEe5djOuM4vTULeVY0+Cpk3OTMBX+/W4kYcCfgTxspZvGE9JjnKh\nlleJ8cf4oxfRAwZ42M2STVv30UERRbM8tZ+mgR5gb4ZhvO85DcRI1bgyqxTG\n7qbfDTNiLFnYTYeyUiPNUFMwBrXpm/3nxjWMM0hV3Lj906uS3TM9R/O1qbUf\nifyZSq9x2keHcYpmwT4q3LW3ZYELxEcVoO5y42HpJirZn45vTt6+mvSEiL7s\nHk7BkiSDMNy6V3ZdjqdK+hd97QulmZtu1UhR14kiQwT97K/lBESrwaQY9gfV\n2wMo/BTp0WYbd+CsKntla2sM8EBevVyz7WMyc/1h7chPaEMhOzd5nrY26A1K\ni6hIaW0NcaozC6oGEh2YtOK0m9DGbnx1r+Y5tgyR6bv3ndNsMqkG8YZBjgLY\ns4sauHjygjn3VO7MHLgeuKklfV+z6l4flLkF+pp1/QqxxnP77js7KKlkTNHk\nhYdHWNhWKyQEUSMChnrRfrrKylRGkW1jD2CrOG4N3OXBdBv7dHEvS6ZIhOcP\nDUu6TMsvsfNeD3qWPxq7QfUrQmpJQx89x50gNb7R+WOQ/WaoZMHGJxrar+nh\nvYvp\r\n=JUEa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDyxNehBvYwtL/74rvNWuahw8DU5jG7SyeSMOhJFoHstQIgHK60NexiKKi02Kud87NVwOqTTUdTUBCnWPyKkjFb184="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.3.0_1562590848506_0.9457226529025065"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.4.0":{"name":"redux-model-ts","version":"3.4.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-GwklxvMjFF6eRBTr8J7cj+NaoBogehuqFl+IdA6jSQ3P6z4WqW6jVlp6Xn0NnMsPhjAyTMZQAo3OQ0fQQv5kpg==","shasum":"7b4d8d5906dd293fef0e7c49f6e2ed5e97d27e44","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.0.tgz","fileCount":13,"unpackedSize":39650,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJA1CCRA9TVsSAnZWagAAuHoP/R4RyN4gJhrLflbow+rC\nTujwbbQs9pyncOm9Ys+SfCegzlbAZTEpi3PjQjgKaBTQYZ+/53PE3faGq3qK\nIWbvI0tj7lWJVAxqAIV4gtQ88Bz1QJq84GZYjpbRmH9VTmRbHmfaUm5l/NPE\nMT2rzgfJhq6+zDwMljTjnU+FjFN+FFXbpgLCvfVDmqbSQjpcQeAo8pWjkof9\ndRe8z0wHwhRY6/PUgtXLwby4J/Ti6N4ZKVogwbBpHRqndFC0KNVCRJCJg4PN\ne3qoGajU3c0N5w1J5CG1/stLWfTo3f9ttI5DQiQYfX8psInRpfEHIPtbwx5i\n4OGLtjr5cqf0vr9/wdLlS9zoh/fJQUnAmiO1f7PvCUJOVL7ZrsAXZq6V8dvB\n24V4zqzx7lcJt67HMUc3wrGb2kJkKb9QVLkc57KgikCtuzDoM5wnLhQYC6ny\n8eg9cSBzAMdmc/UGAZ4H0TDamEwhnIGA7gFdQjWcedFl8tiV1tk+Ho0Sxi/1\nQwwUmDkGB3iC7Qx+2bsusBydIGwavQs7tNgZuqvN5DouyBYeQoU5zcZHsvZ/\nG7Sc3SU9B+oaUaiYkLwxWYoB1IDlQWNJxn7gEcCMzz+t09qxOQnCosWEnKUF\nl9TkA+1yzB7UxEv35mc4pIjA2Clz3gd1F4Jf3tuCfSmWzI5TG/8YUQ+CAiaQ\nq0sR\r\n=KTvK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB7YQrdAkeXE0C3Pj4zU79jtzmJYlqSp4v3IIqTKU1cAAiANfUoYdII/Wah7vMutQYmiENeG096hiYQslamu8ZlYew=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.0_1562643778058_0.4702245278946815"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.4.1-rc.0":{"name":"redux-model-ts","version":"3.4.1-rc.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1-rc.0","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jc0m/JV/Zd3JdA5lDWFl7omYkjMVCAiQLapD1GenDUCbDfvF6tvswDlrNbuYsCpdglcyYpbQIIviR1smlOqy6w==","shasum":"5696af72ae1180d9b7ccdb4c4b8431898ac6e3b1","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1-rc.0.tgz","fileCount":14,"unpackedSize":40952,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJEJlCRA9TVsSAnZWagAAR7AP/i3yDQARMRo2My3rN/CS\n332f4lq1tzaik9ZWFL+qa6LL4zFO/3k/xjsf2jHIG9uI60Z+ZD9AwUjTCk7V\nkQDclQPaJ49WsQ5w1nyXwm2VjkTlTdkpHtGc+/iJ/jvO4AuGvYA+tol5NQcT\ncIY49rpxRS+S77S3DMvFal/1Dwk6XkEMhayWUDaO7V09/MUJNXGuZ2NhwfUg\nW24r6viKzL9Djr4HI6XHQ95rJCPofWAmXZzcDtXikohYswuw4unOB/Ca2c1C\nkQkDXFTRD14E1D1Gm0Z+YrMuvyZnTIWhvoRRgxPY07fBsKudiS3a+urHQ3/J\n/mjwMiq078eQE6D6o5IVICvxhFU3pPApbWsiWJWe0rmzgbkpDOSJaHVXkxYz\nkDq7SGf+iC5k1Zs8EoQeWIoypFbkmnEnJ1LyxaEybGMd45zuENbd359ZsP5R\nyNe3s4QvPdQY23OtiriueTBUYEAjznlQy+H294K/zZBEdimoEJipM1REkCOF\noHAgfSgFwEwpSfH/t1lvDkElJlGGWxQALHXrf+ObciuSJCxjAhPbqCaUVBLF\nfb4gazO0yCIcVe2fLBrmUd+mMFL1xsqrAWQ3GDI5jtmjEOtLTohSqjyiR+Jq\neRwBILySfa4uAYnarHci2dbRO4ubGTO8rrt7ZXYDo78C+sqUWtZrckZZ9DLH\npfGJ\r\n=pR+Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcOhvk3Y2+DvLIgzq30o2lljSfJDftt/WT44FEYmwpfAiA+SvCnkq/BIResNJJaFk8SzLqDOokEXqdtKuFzvraGxw=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1-rc.0_1562657381178_0.23903112605404986"},"_hasShrinkwrap":false},"3.4.1-rc.1":{"name":"redux-model-ts","version":"3.4.1-rc.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1-rc.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-y5tGwkQnWDCxImq1m98iR3lsSPHHSyk2otEI10m2x/iMDVU+6hDxLaSBpzhiUv1IdXp7H6w3k2ejPDjdXlSQIg==","shasum":"d6af172ad607e16bc34b9c543c4a4c8b61d8270d","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1-rc.1.tgz","fileCount":14,"unpackedSize":41001,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJETsCRA9TVsSAnZWagAA6SoQAIozaRGVN/ELZsgD9aX0\nfdDmVkEKuT7pcF32ya/m+WvxSnAT27CZkiiE2IDXL4NmdX0wPqAFHEv/Ynjn\nDZ70HxatVfJ4uY9W46X3mnwFI0esdmbGO5pP86st3YqKk46qUQfMx0MFxoIY\nktDmjw3+2FZVhkGtCpJw8258+DHrLqvqQf5jFibO/tvRQMbMLAVnUXQdnrmP\nhZmPHXY9508mn3eyIh+hj3JxjA6/qzCvD34e6waZqOK9fXJeI6C9/pSJFVst\nm4+H0h6cAotRTc/w5ap9pevxzm2KwuYo0jcjKUo2Zyt1he2Z8XBo12kTZEpI\ntPC+y3kyVygA/hARGht9PHcu603e7SfgKlw6nrmid2BfQQm+/CC0QKHW9LC4\nRWgpUaWd5PgSKdkz9MpgjZLHkHZWMS9/+hS0o8I59pe1Kww9NTGNjEFtIvwI\nD6H21jzxt6d1GqKQv/grL2tMxHiGwZb6uPimOuJHF5e5R+kpZWeNHQH81x1/\na8l5ypKRAMMmw5vumCSquw+HsD8UaUHFZ3QZFw303ub8VPPvz925Ni6smGAj\nPcaQhhHpLu9U4IqunruXSp4ke4OkbprAlSXHlK0tFSgoMAjFr8DyhsBEgcrh\nNW0+8Es+JPxoJ3WKFzYxQU5t3aGOpx8k8AanXE5qwr0F5lYssUJS6Z8BrOFy\ncm+S\r\n=mLEV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjtdjYA44d6PGa0uK51JyUOpDCMeA69EMGEjTmXnuNqwIhAPz3l6YcD7HhAkON7kEMKgjMm3l8sEQiYlYdSMHCOARZ"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1-rc.1_1562658028194_0.7635765701587951"},"_hasShrinkwrap":false},"3.4.1-rc.2":{"name":"redux-model-ts","version":"3.4.1-rc.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1-rc.2","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-kZL2OtpZ2XDa8CVftxjwxUepM0tme0aykQIC7E0CRdnjfQfn8ZAg7SXkNDXWG+v+MLmIurOipjQxEqe/rrRzjw==","shasum":"0b62fd2563942a7f00bd19fecaa069d91f90ec8c","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1-rc.2.tgz","fileCount":14,"unpackedSize":41037,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJEeNCRA9TVsSAnZWagAA7SQP/1wUN5rgpjzej5ODqbEQ\n/NALd6ZqXvrnR3gQMUaOO8FlYL4W79RYC2Pmy12s4YjK67PXDXPxMsM8X67i\nKukU1f7KCR9E2D7+ma7+y0LNgn7TqyxbdDKcQgowSjqOtIXPmLrqjtg/pNbH\n244YjNYiT44A6QH+nL7kWEs7WDqP3CLQ4VSoHA+BziVCGO84AUzYI5JPsN3A\nLLen4PqAIouECZYe8K29+EiTeE4H/cbD2XPRZ++lle1rYCzCvZfhykbT1KyE\nHIM18EGbf8MW/9nqgevXvDB/hhmJYlrhWa2WY06F9IdvLmgo840ioh5WxDO3\nXgwyXRVQdNqDav7JixAoC5vgy2+C+VdhhcwcWf1hYbM89q+OXT8sxVoso0gF\nZAbIUKk7LKUEiaGzodIC0VmAygMeUu8RGjL9ZU9Gvl9uq0sZ+nNBjQMAMGiC\nAbrH3wubI4tUzWaDBPGSr4z+qGffzO4AEip3p2OzVqEUesPBGXQQl4vSaIVZ\nmPpWT3sgLgwbQetaPyLzHvzC4/fKPSkECPRWqpLBcYvsFZriGZ8zqKCMlfYI\nvnm2O9o9A7lXqJnKZe7H08cJ3LsHrZM4iEKWm8yDaWPETdgnJmBmLwUxRuTe\nx3eTKTH6JHRFPtzz4/4VDCUpnksLYsBDUZz44A5cOakYVsm8quKcpKCgBlLP\n8Cn/\r\n=Qv6V\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5ocBVIk2cCCXQmNjCSr+dySZ/hWK8GJ8iPfg/TX4WDwIgSGlXld9kL+uW0PRDyQ2kvIZ0fCkCm5AlLXwkUnlbhEk="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1-rc.2_1562658700990_0.14898642513812166"},"_hasShrinkwrap":false},"3.4.1-rc.3":{"name":"redux-model-ts","version":"3.4.1-rc.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1-rc.3","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-jwiifeJNEcbM7QkvJJYRAcwOl8ygMKGoZzrfazWGW8F3J25tOWgWAJM3tEu2AL4mwHbMGs3PYfJ85Igc5GQxoQ==","shasum":"ae30e532c79bdfb5f64109d1a373565ad3311374","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1-rc.3.tgz","fileCount":14,"unpackedSize":41153,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJEjjCRA9TVsSAnZWagAAKT0QAJz5Lk1F99aat0Hg9tdP\nJv7bpadoaCuj+4VYuWi0nGyfqtCz9p0xl2avJaC5AVIs4Ws8LHgnlni8BIv2\n2YPtifKlRhkPkWM9SSMH1t/dGYvgYbdixS2qBc6EFno5XA3VNVpxASaW3glT\nOTfiX+rLBctMjnUEsTDtAZ7SOpVQwkyI73Zzo7faiYI2CAumUSHJKpS+cjOw\ndjLir344Na1skSYeNPa5JMu5jEcMuSgj6bN2Dzqv4Hb8rHf+V64a2kgcWzGc\n9BgrHsi5+g7gf6f4S8J7f8c6ctgY4GPGUTjUONfCcqmimuJsc6u/e8D6vN7p\n3oC6FtHUip58EEjbtHYeeQ8uhTgnT5XS4UNBSxOos8a/ZgV1etOXE/2qe5L3\nHnQHWVbRu+K19oU7UDNq8U0XYTPDZg4/R67H5G0FEeuqyCLr99C0yZv9Emwl\n8BXudAnqSv/8vsZaAbxLRe8RH2Uyao9x1KaS5sY1HWPdFOKD28YZIoO4ZNfq\nUfFNxTe7J2G8tiYZKI1O2GUL2rIrw3a/my9D+HGlE+RTj8jgjuFtuyCtoFrM\nGMONZdfvaiW4bppdvJ9TLTBKfi8nmquDFNfy9bDupDWMmkUCS9u/2zFQJova\n2VJg7ufS30eNQ2MQdIZ47xO7gUtb0aN4u8nQZz82ZSvMxDYePEfZfuzDxnTy\nNXhU\r\n=IgLt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAE/0pyYI3HN3NKk+v+hAqNkZVF6kvqJyhXv8elJMnWVAiBZFzr+WaT/bAXb8VLKbLlsb8LTeofhn+8R6gHsLfgFpA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1-rc.3_1562659043327_0.24197228705495943"},"_hasShrinkwrap":false},"3.4.1-rc.4":{"name":"redux-model-ts","version":"3.4.1-rc.4","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Define types | Yes | BuiltIn |\n| Split action and reducer file | Yes | No |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You Will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n---------\n\n# Usage\n\nHere is a usage case and introduction for every one:\n\n```typescript\ninterface Data {\n  foo: string;\n}\n\n// Create a model. One model related to one reducer.\nclass Test extends Model<Data> {\n  // Create a normal action\n  firstAction = this.actionNormal({\n    action: (name: string) => {\n      // You can inject generic from here\n      // return this.emit<Payload>();\n      return this.emit({ name });\n    },\n    // onSuccess is optional.\n    // It can change reducer data that is in this model.\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        foo: action.payload.name,\n      };\n    },\n  });\n  \n  // Create sync action\n  secondAction = this.actionRequest({\n    // action is required.\n    action: (userId: number) => {\n      // More methods are defined: post put patch delete\n      // You can inject generic from here\n      // return this.get<Response, Payload>();\n     return this.get({\n       uri: '/profile',\n       query: { userId },\n     });\n    },\n    // onSuccess is optional\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n    // Meta will store httpStatus, errorMessage and loading.\n    // It's optional, you can set false or ignore it if you don't need these information.\n    meta: true,\n  });\n  \n  // Dependence on package redux-thunk.\n  thirdAction = this.actionThunk((name: string) => {\n    return (dispatch, getState) => {\n      if (name === 'bar') {\n        return this.firstAction.action(name);\n      }\n      \n      return this.secondAction.action(1);\n    };\n  });\n  \n  // Initialize reducer data.\n  // You can return null and remove generic if you don't have reducer data in this model.\n  protected initReducer(): Data {\n    return {\n      foo: 'bar',\n    };\n  }\n  \n  // Receive effect from other model, and change data for this model.\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      otherModel.customAction.onSuccess((state, action) => {\n        return {\n          ...state,\n          foo: action.payload.foo,\n        };\n      }),\n      ...\n    ];\n  }\n}\n\nexport const test = new Test();\n\n\n// ---------------------------------------------------\n// ---------------------------------------------------\n\n\nexport const rootReducers = combineReducers({\n  // We should register reducer data from each model.\n  ...test.register(),\n});\n```\n\n## Middleware\nWe should configure what can do and what can not do when we are fetching api. So, middleware is required before we can use method `Model.actionRequest`.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\n\nAnd then, inject middleware to redux.store.\n\n```typescript\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n\n--------------------\n\nFeel free to use this package, and you are welcome to give me issue or PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1-rc.4","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-rtpUD1XRr4aJKk3eAv9jsbalCCXTcEGJRgG3dR9lKfq5n6bzIRAbiOmbnE1VkDyiCx6HOZ2fPwf657R49Lny0Q==","shasum":"d50c49fa3f7837d49f694c91217aa979f049aef2","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1-rc.4.tgz","fileCount":14,"unpackedSize":41195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJE7PCRA9TVsSAnZWagAA17UP/2C5ZCTNNb4oT0rybLmv\nkWvdcr0w2Nz306q3boePOoqcKyrrgfLQhMLDojLTgToHXJhP+16vWqo/sDu5\nc2aeGgo6i+P4AiCJazFHQO83FXsomgP2pMZUc8VW98C2EXgqgYtkuI7LdXzl\nocfBrmOVUmpwSzj4zRSWfByo7dj3+0CuRyCzwq+uHvhoLR3XRh6GSTLA2W86\nGrbzVk4BXaisJQUy1+PmpI9v0vD3S7AX5ah40qfQuqA5IAu7CfvPLlGgGmWY\nLSWJOvBXfunL7J+CyX6NVMJlU8rqPpAeOq+IivXnZg1MNwNcrZtFKZzc+7ys\ngGfGPnqnN/WGt4azXotlz3KF/6JowxKl8m0vcpy2IVwl3vQ9ZFHJIU1SXHmq\nvUEBci+oB9siByuopYcwl/ufcsa578n3A2CxHkFYlX1aTcpcosVLEzZDQcF5\nk1iVW+1cRe8aKV6PV9O116NOuCSc3qhCSx502SgQe+IL1KePyqpJjXFATm/D\nE+qGQyMrejwDs4vWcQZ92QkpZMCBLp4SVZN4rc6K63wRzLqetUiABYaOx7wn\n0vLTCv0X68yrCjLeIWywlROjFnh1j/faqVT5fc236MPJO350jr65m57mQqrg\nBAEePQLCX3BFCwFXN+9vXJm9QjEnkQC/vtPRlqpW7puNhpc3+ubhYaMr5IVC\n/yiW\r\n=+8z7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGEuE0mbHgV6/SqjZKA9QcKPpgcTDinoj1nLY1cJFNcqAiEAkJjFMXdgRZGan1XT5jj4GnoRZayAjS72W60GHvfeg0E="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1-rc.4_1562660558558_0.39469039797380967"},"_hasShrinkwrap":false},"3.4.1":{"name":"redux-model-ts","version":"3.4.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.1","_nodeVersion":"12.3.1","_npmVersion":"6.9.0","dist":{"integrity":"sha512-xvB+uDKWMpfTzf6HiDBLP+69gn82HUVSN7Q/xYoCXRH43Mp6ku3/gMBZ7PdQxqhnwozXOIq/pECTpRxz5bQUtw==","shasum":"42ecef56f86185d7044714f622589d24c35a5931","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.1.tgz","fileCount":14,"unpackedSize":41322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJFC/CRA9TVsSAnZWagAALaoQAKQ5zALyKfFZFJzhLXzJ\nXHLcP3Ee2v/06BujEUvHw4k1On2zthK7ECIlRFCOSQpvhqQChabBWjpqrYB1\nXyD6a7m/vYt9efmXg+GVpoyvK4luooV5V9kktxb1z4UbZD68uFvAJICtIo+I\nZAyNvB/WPy/rylLj4ZJk3dm6TQOINHE2FUnWZ9AczJ8b61x7UYhCRCPVfHoH\nECEjhvjm03/zo7AmNOb8+wxPxKLxFnYYNURr3PERoPm7cGMQm6og1gNhUxpn\nmjZmQshQ6X7zqIlumTv8VqzHB9leadbDczMTrGKSz70yA2PS0KC9+hPFMSpo\nF0qgveTmhhlzuqw9PDu1eAjiRiX6gOQqFpqD4HufZBGLRNTLT8gsLdPP5KwG\n6u9KQBUxATLTKRt49SQAMekHToV6/gHI+uwD/z0fyht5ekoR7e/YvOS5aQGp\nYcXwixBT9aDU6qrltfdFO5hkdRJw5iNAiGp/9UrEm/zMdpp1sq+RjqqqHwlO\nLK816ND3pK6ugdRR5vNuWn0lUeX9T5N0YwKoe+gsOshs+W2xeeIBfwES50Ca\nwRrbtAhXsGsUf0Wr/BCvKlSWe/carZosJybzYfsZ8P3gN6qG9jFPT5n6EP+1\nXWuEeGvEDxm4tOHGJpLgaLClMOdyY7hBSKSW6nrA6oriQlPYNtDdYiZhkGSq\nGSJd\r\n=sTws\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1FbCH+SFMwKAzjhmhGf5BX/Zqa8Y2GcRa6f81gQzuNQIhALwGcobyBrJ2iKMY1x5Pxd4gVeLdIR8DJRDBF2pSnEl0"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.1_1562661055150_0.9751923761666303"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.4.2":{"name":"redux-model-ts","version":"3.4.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-y4AdDuLRFpXb5gaavGHuS2XiMyXBEVfQjh9KJkCLMTJWKBcT6fZ57brk5NhtENpA5XvD9av/FmT4zsNa7I7Wsg==","shasum":"b41f68f6d107c82b96041c1ecd316f878122cb4e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.2.tgz","fileCount":14,"unpackedSize":50372,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdJ/giCRA9TVsSAnZWagAAphwP/3c2c9D0iWsMMTfxf+Xx\nZuR4abV+Gfuf3P1zid7VCou5yOrT0VLsCBIheK7D4d8yE2BvIn7mDiyjSPpz\nUbMaGJ2cNDK6ulxeibBieMALAimpCskVizJa6rI5DhZ+IpYHm+zQTVX9IJj4\nK+xBRUDpgzn/Czuf68eHpHsYcCbozDz7VwVHdRKhImYGmbHVDHuMCBhdcTuj\n1Is9p8hjQz/3w4bFCxEmGw45vCDMsh4QqDSLab/8BH6+FeGGuF4iYV0ith8E\nEVH9vf7eSopLrdQ2N4LHB8nxIc7QC6UxFmcc9PlpapH74dDjsekAncs39HSf\nL6/xi18/ht1ZRdwYzGvLDNmaZ+6LA2VBJLcrsaEf0YqQ3Uf0ycAWgF0MvRxv\nxeeu+/qkNDYdZSJMk6TzVtyngnvX2NY88C6ftJDmDPkwzEcL3ajQywzEo2SU\ny3j5MTkM9TM9+XGiFZmRRLPEmurfbXD2lQ1WurPRPJ7ER6w3GgFv/OBDu2XG\nZgAfg7SEfTC2TqjF5V2Szj8WTWWmJ/7G2EB3Sblkw0FLbUylpMx5Y4WwmDj/\ny0mWn2ErXoksyujh10pKyei7FokfLsu9br8a2DbY6EUKRKxg7Q1qfK7rZZRB\ndD+eMhxfJ7St5TK0B8GYhe0vgeJ7O40GpOfCBqQ88XOplUyLwkKLzZnOhKA+\nnc11\r\n=qKDB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEUgUSM56zx77802Sg8xWfwJ1VKXUOI7CBkodL+eZjZGAiEA719PZuA/HRhMtCjlsCYRI7g6wT9Ugw/HEjAZ5KC5JZQ="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.2_1562900513452_0.45394855729026795"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.4.3":{"name":"redux-model-ts","version":"3.4.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-ETeZ40vLyKjsNHnp06u9l1pn7c8+1MwASzRKRDusmAfTLfkgnwh0tVzPLF7yuSEr6N8pVXGZoQLwQgm/u5H3HQ==","shasum":"36e2959255485e79f895e4d60ae801a3374b1106","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.3.tgz","fileCount":14,"unpackedSize":50446,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKJ3yCRA9TVsSAnZWagAA240QAIb+U4JCUCaDGDs+XYU+\nzo6rty8omavb0guoWoexdVilLYiRV1vtTFR2OXA9F+554wosxc74t5U/Zm5H\nzQsRHjmn6zDh4l6ksxDii1L+6/gBYIINsJG8te6RufDstkVvtFt7k2k8HjC/\nIfPvGHTjXv3vGpzALDjOwXj9ryxTGN2foIxnSxm7EL47F3Su58tsIqf+zy2x\nd7yDEevmPvaVtuODIpGISRP2tNCH/2CzhuMWVu/3Cjv1uPD86CWBKU7ZeZjS\nofKTPcfYYCMNksvSH0ChMaXnOWhHvXZm2KDnsKwwcbeVnBGVaTW2kqOw09Y7\nyV9TNIXLB4OMKP/ANKvDRz3GkOMlfK9CeBzexKbwV9NQzpISN9MHSAl1/rtf\nUwzCfEDPO2yCyEkMMq5Sz2azvcMmykLsMpqjq1PE6stwKz3y87ce4ucJSFgm\nCXbLBjmp0zVMkEND49FrjvTPR8b9hMqJ00hpn89deDYTsdqb2Zn8lLE0NhV+\n/qqDSAylSwHX+v5KdEuXxx6dgZIOPPObV/hkE4FUsf8lOoz0f4UMwcSsQnUg\nwwnWGIW2u3vXLaRGIqFmvOJgWwcTvA868EIOVJnf6Pw6nSFoZt/eH8DwH2SE\nEolDmpKaFo6ugHDsXRI4VAxmDc7IF1WovAH+EZIUZluY9Q3ONWiAbobXvzlI\n9f+q\r\n=CXU9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmkZBSUID5k1cwzsKIsqUQkYwBjIzSnF6vSoZYNCG3wAIgfCYmUKHCxJ4HxHbNMXW+xr0s/AN1lT0pTtMhUIrXe6o="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.3_1562942961406_0.9729497590399607"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.4.4-rc.0":{"name":"redux-model-ts","version":"3.4.4-rc.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.name);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4-rc.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-vV4AQ36S3rJ3uBu8n3ReEEVEvNkO0zbG/eK+YI04SE5mw2Q1/imSt/lkCkAbwCrjxjZMmpDhbQhqqdgKfBp/Gw==","shasum":"231ba45d1cea8e14a1615bf352805421e1714e57","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4-rc.0.tgz","fileCount":14,"unpackedSize":50349,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKZcpCRA9TVsSAnZWagAAASUP/Rbzf/e4utk1fKMZxGsP\nooXYC/j+LMU8aSnpgDeyosmMaH3s+tECCrMafhwwoNrwJhZwvLoVjSf6Nk0c\n6rWtuz5tGZbRIwXzZ8FIwdftKe15qqtQrnYvdNKOVJhoHUhU72iAC+Nbjys+\nLkUVbilcwfQ70Amxgr7cS2mQAWUEaldS+621P2Q9SzDgOi5i9kp0GORgd6Go\nJqC9PmhZ8vzkbg4sq3qc3prAAvpEh4uZhvtzRHPAsqcqLJcNkhykjYcHU13+\n4sbB6DhsEoH5RKn0vMwsIwyHI20p8sI9iNy/oGW3KJfKkVe0chOhECMqe2Ol\ngpRTETz3jqaUYVCGd+0opaNd610otw69J5y8xRxi6iCPtMV+KEIZRPX200ru\nJgc6wHf6cMv+E9aOxW1x9TPHNq2U3dR9bq4m0Q8+/QChdkAIiw9RzPA/VM14\nzn7NGarJtZdwE7H0gL5+xfoGaEwTfciozUIlx94QX+DJv8nix+JS/rsElTx3\nkXCAaOWBwtQ3dpzh/gIN6Yt/8qgirUGigeVZsmpqGUACGUZ5y02hTPKK8ml3\nbmYof8J49toP+3YKSRZeTKdLCU2vXR8Wx1mRv6xf5tki8B11Yy3ntCgD+huF\njOECUN9jP8xGA9nbcZCuXWdfm9Xj/jcVCALgyX5ikGZXZDW8x4l5rTUOS28W\nJ3Sq\r\n=s/Uw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIaIEmLur+L9uaUWKFzRNtnnXHR//yHipJHnNCuv5R8AIgIhvw85QG/f/SbIioQ0g9QWxqFVTjqzVt/QlDp9JAwRo="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4-rc.0_1563006760437_0.5899549697344448"},"_hasShrinkwrap":false},"3.4.4-rc.1":{"name":"redux-model-ts","version":"3.4.4-rc.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.name);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4-rc.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-cTBbPAA2F7KWQ6c3zpVMgb2vf9zWthlu1lE443LlKc/WmV7g5WHz6e+rsze2jve45CREtlWYVvNsQojyL5nYvg==","shasum":"da260ff4dbb43d584659c2ae6df0e44813d44b0c","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4-rc.1.tgz","fileCount":14,"unpackedSize":50345,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKaspCRA9TVsSAnZWagAABGoQAJzGCUcbTb9H76dwOJZI\nQHnR/fbugvuzky/TWQOdcqUXitRYyNq8gVc02UdYnDYsmwuktA1NrxH8HyrU\nJ0darB/Wl6rVl2x0rPIdB/oAW9AX0gtTHTN4ATYW30JOlKBSFC9ZAT9UdCS1\nqcJCYQGqJdFG6vlt+UNH1A0p4BDrmz+7P/OMBVUQuGaTs06XyT+9kCeNHMDf\n/c9iAkAJUjnuaU1N6ypdZo+PZTPhihd09NgJ9PrPCMO/tvE2rTzAIs7o/ZA/\nLQcO2Nam0i1rBmesBabpbaSgu/QZ0h5RfQHPai8Io+dKv4EhXy4zMHQO2x7h\ngPqZV/vUU47HzxmmER5OtAd1ZsITS23G0LDft/BiZXSpkXhh1bpxN6CZwbD0\nyynDSfWlYSrLFOlVA374Y9RF0gli9TO90S2yLrWiqpkW2q0qmaQGq6Qilgcr\nVYmu+S9SgwQ5lbJ3KxHSyLfF71SrYkC/nb7XZRpU7vurN5U2e7jgm/D3DU0D\n4uBoA++FaGJttzE6H13oXy1b0+cFlwlAz0fuRUc8CEcSrTpv1gg2sHh4Y5Q8\nKLHlRyNNdlLzxLCqzZm7+ssFRbx+qPT7pyAs9Yk1dkazfGAJUeubkc6v+4VJ\npUBuxyoGpS6Y3r4RhxuLl7ZMMkXr4E8DOp+xsnBKe0u/Ru9MA+u4Rzge4+Qo\n+1Is\r\n=L5Zc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDGWsdLuokZ93zpvUUikxnd+FnzgpJSvsO3Ej9Fhkcq0wIhAP2KLgsTojMosWR1McxHDpamMZdqsmw4DRIMmQgiYgIh"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4-rc.1_1563011881104_0.1897428880036569"},"_hasShrinkwrap":false},"3.4.4-rc.2":{"name":"redux-model-ts","version":"3.4.4-rc.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.name);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4-rc.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-g0fZX4E7KEyDRons4P92uV88lkgMgUmDYQQ03GFZQ+bDZVfq5pky+seshQN9h5n9g4c/OBAtSwKiWkwk8EfDRA==","shasum":"73356ef09a5ff3915ce26cf964388f32c220603f","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4-rc.2.tgz","fileCount":14,"unpackedSize":50364,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKbZPCRA9TVsSAnZWagAAtxcP/RnK7ZtmvY3niU8onCUQ\nshZCFA+RQJjOWJ67bmSNT0kJIzzztQxGVVzYz2QL57mtKgN3reOiQIHBCFKH\nJeB2vSdsZN2lh6dMHphFiJCeh36xUuXRlOS4a2YGCH6Glk+OUEG1kv43T4aT\nmr2vdqyYczwUHx+lwC2xZzYMGFl8hGbiCFB8fGwOMTDFStdoLfS7E7EsJies\nfYqvA52kt6mW7JNi3g4d44dnsBjF2h6NtgyzaW4pGQx9D+hri/VVGbjRhfDU\nRBmSyluMImtEluroOSqqTZOfhZaei3N45jy7+oZMjhvsu7L0EYWav7OVCkIp\n9j2ooYbP/fDvNJCI+3Yymky0rczIAl3lFj5C0bjc8Bb1nt/AbTV7uSKmA+2R\n/3LY+QMWCzpHFJZteiCs0uHf9Qh8yGPEBmL9tjkSuUTm8Xr5zHbjDWEkne7T\nk0n87rWpZlhhE17OJeRLq+N04N2eGV0wgM+F4K0FPADco/t6pKmJOLyPj8y7\nCev4AK1HnNP9KWHqrJV/Flo0KANt563P91mQPJqr2h9VferDp8rur+vcswEB\nCyKpA6gfuk8ZxDfNKkAjnsrb23DV1S3hluWxyWCKsGqGWlKW/vBMcT0n3OCj\ns3slEsfofNiyj7GdqWgFt9gkvzuTVN9G1TXeBrGgDJ0rCa6VAxWkCIefvcn4\noa+i\r\n=yk7W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFX2arH2J9BWPuHrB1ZMxU1lqpYuqRDN66p5zdVhzqyiAiEA/atNG9ADwvGT/H9Zp3HlJsUdDxhI3mF3gBn6HEglR5w="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4-rc.2_1563014735261_0.5956005087894147"},"_hasShrinkwrap":false},"3.4.4-rc.3":{"name":"redux-model-ts","version":"3.4.4-rc.3","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.name);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4-rc.3","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-Nm9gpMm+g+P8Nv9wm/3c932/Yu9tuSXgQ5udG9nmTCKWJ49pDmCCCNobDq4+klEfa7M9q44YISR0PcrcJWr3Tw==","shasum":"15c4b13405ee5090ca9cd0903350e37e77e1006b","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4-rc.3.tgz","fileCount":14,"unpackedSize":50418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKcEzCRA9TVsSAnZWagAA63UP/Rzpi24q/mc56dFH38e1\nlhuKjBzTbgj59voaYVFMDxLBNIAbMDXeN5843A0PjKyqevD1K/mbzjvZzcCZ\nn4o2P44vHixLmLBuicJNObfk7v+cDjLsTYr6J7GxcEbdtEbL94610wKgPUTj\n4fpNxTwfANjSxuGX0zxlcoFZF4OL+8qGbbnLPgpEPRArpAqwyLrnyWSkIMZw\ncd9vyr3mKBROOZtXPuzp6hcCopOARhdEgJgnnVZdsLyMcOdPfIokxushhOr8\nM90W6Ax+XLMQIrYSHeFlZwGHwOzwEaR4IHZrstDCPpeT8E1OJ9hwM3LiF8UO\n/DqvqHuF4WHTbOtgbvOP8bLKCJstoKDzXn50BCuJy3Rj2moKNrbjdQua0kTY\nErx2p5HV6EHzg+s7NYIFe8IP3Bp9YLK2mst/tSG++mhz1Bxlja5UW4vnu6DE\nsYjMv/nGgSECKNs6+ef8V7d9NtdFPLxXPRlPnGYch0cb0oB///XKhWbrou3n\nwZ5zwGOzUJzXirCwvdRmIMaOHxo/vgDAAvu7Hd89N6Rrr1VEoC1VGhy8jXwv\nEIhgfePqxBnY1mrG9ZJqCex1Bnr8JokssiZg710MIrUv8U2eEA/VR3GAcRtC\nU3j9ujGvz80uyQ4Hpru6dIAvZPFYcCNUPjkEWRK9zG41s0T32pfma/RbLYgU\nCTwL\r\n=So+q\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBA2SfPZN7sIcwtLR4D5kAwh9fty7+ex5HhXr3ZPSOyPAiEA92jVkt+5XQlw59u62trU+VNJfcQvFIDuNuKpCYO1ouM="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4-rc.3_1563017522990_0.28887583706480435"},"_hasShrinkwrap":false},"3.4.4-rc.4":{"name":"redux-model-ts","version":"3.4.4-rc.4","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | OOP |\n| TS support | A little | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nClone this repository, and run code `yarn start`. After that, open browser and visit site `http://localhost:8080`.\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.name);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4-rc.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-XPK6BFIldyFAdT0aTbCeemks0fver610ot38/yrZE7oYFs/gAkDtsfC4iBYSru+z+GkjrIsYM21HCT/rZ2v2pw==","shasum":"fbc02aa89df7379925412421457214eb61ba2f5e","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4-rc.4.tgz","fileCount":14,"unpackedSize":50647,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKcc+CRA9TVsSAnZWagAAR/oP/30Y5pkfQtiyUacO7VqY\n99G8mKZh0AvARpkkdBALZrnR1SaZGDgX08Yb/pvkd4tPsH83zrtVwufXvuDv\nDIkNtsCq/ntACr7aaaTTfB5ZIJlzox4aD1XzWywvR5nvCdyRuvYMoPoxF9WY\nnVS6qf+mn2u7/eFDPcsxRiSQ6CS7yHzyMgOa/XYuUeCUIJ8LuaKE1yEi0DwW\nEu3njGh/mBqF3Amf9SJslPw6GokF+Z42nCECZMkqsj3X9a1st3dPL/rcKhXd\nKFajAJQ4unPFUMywWhzp4P6vCYrJToVReuSa5Im9pqINy22pEPFcRcjuL5lF\nDcc5AdCYhnJbJR3W7hWARounuyRYFC6dtblT/lPe8V2Z6BcmwVByQ0gtEvlO\ntojXzXV2anGdfeTG4V+eVLkL8ZEUdQLjvQdhut7i62HvrL7hJWkDsB5gsNEo\nLO7+lBMyQ6wcd7L0DIKFGJdUO4l52se/YkUqWxF0vgeZbWVifpkghQth70vp\np5/SnQ5HghAxlXgt8EC9VNj5+9v/N0k+7vcT+PZOOtw6EegQgrp9dExnji7h\nNMi1m2TvtsCpMy+jA4p7rG85xhJg638CPnASj4tX/Kr98AzYpeo8JOPqz1wk\n2B+9/vexD8nla1BQEFcA08yUO0trrTJZPSFGQTuEdr5nvG6TV16JngJHrgL6\npvRA\r\n=feq4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHd8YP/rlKIKEUcSW2AdwTQT9sjC8OBPNJ0RnEMBMsb0AiAMzw32PHM6f+D+LUNCDop6R+F0gsIilq55CvnT/RfIMA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4-rc.4_1563019070272_0.7395314319816442"},"_hasShrinkwrap":false},"3.4.4":{"name":"redux-model-ts","version":"3.4.4","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.4.4","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-n+YVvrKsH+Px7ovqufcUq6M+swnK6WGaqSdc2sQyXaeJjt+CXU9ahyGydy0Y9cuzGBWV53CSxJc7nEzQriUlBQ==","shasum":"7940d281e5a14e28984abb80dc8babd83117c741","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.4.4.tgz","fileCount":14,"unpackedSize":50707,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdKcq+CRA9TVsSAnZWagAAPKcP/3ZsUt2GQ5nV7Ym2Y74y\nvXMPCJJYQAsLxjoCSZVvGMeUxMD1+3SfMG5DjHEtaxvgiQcxJEdAzxDXUc+/\nqMZ4AGHYXC7bCCD1ieoeR9Z4wFjURRRT0+z9VYwmst97PD78n9HfZ4uwZF8W\nmNhWqYbsLueJ/TSbS4c27jX0HI/VwykKap+8iO1KaKIKhVR1YmRQl7xB6Ra8\nTaPfu25Qojb6YP3S4VvGJ149mXJiNp9zOvTZxl5XwJxZhVkYD26Yht6R7Pw5\nqLX/CQzvpPJhOO2mkVKJohx6ZwZ+MBmlHhVG2PyAsqqIjgGzTSglGb5SK3jF\nRWcCluYjpouwxhlUlx83j42WtnIBGT/NFC22Rqjpp3E1YScGCFgw4KkFyvzi\nWgf5vh2VJ79A3zT7bdorEAPdu7dFePUYkyQpqXvf8IQt2ChyB2ESluFQL30V\nSll9T7xFOiNt4BJlD7EHlU1CtXyjxKZacVCR0Xyda/dAi+xXVJAUrqVvbVu9\nHK1Pao9nCzmMWholn8FMQAJmnzJaN2S5zN/wggwSm8CE5pJf0vNRagkytRrt\nbZ1AQcFEsP9cs9b6AcTKnwWHC6uvK3FNU60xZGKz0iwZwtPal4pJG4+RMm/w\n2y32sbjkfyWArQEWmS16RCnFQUV/SlvqwZZ082KpTGpxa0e3pHKK5ViD/vtb\nrTX4\r\n=abtF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFdA2IPNOOylo3Gvn12Wt5GJgakCZYkqIhNGo9r12o46AiEAt643Mamm0p7kCSzbNMfqd72WVrE+jlz7WEJYBuT5BEY="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.4.4_1563019965390_0.5318119426788033"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.5.0":{"name":"redux-model-ts","version":"3.5.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.5.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-U4PXn1j3xpZB0DXmpo6GUpWBRSU6OEy4lDSGfpGXYdCVTidp/mgkbvUPqiJzRGuBNc2zUN6O0D4foOLkaPQ76A==","shasum":"cbf19dfe16704270e874eab6f611ad30aa266808","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.5.0.tgz","fileCount":14,"unpackedSize":50924,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLFdCCRA9TVsSAnZWagAA9zsP/35cTRNKec6UgC/TJHeG\nZp85jG9tafFubq0ErUJuEMF6WY9tLlKYBmICwh5nkuYXseK2yelX8+HtnNRb\nQS/vmkSqq3eZ9IckoIFWGE8iOZw1WqSBQKTMl7RAVbg1JL2XWGXEXVtb1DpJ\nZCk9Ht2R0Kigv8cN2QQCnhhv1jONeZBk0sWMTj13FPqpgWiGgt99vrW5nk3P\nPv2WI5wnAdV9b1Gj8/2yYXj+UqJrOORbNmD2vd+6QHQfGkNqQLbiZmCrhAot\nKO75JNxTO81XZsDfW26eGge8CMXTCIVKXynnWsSBx+JyJA1k+91O0fjeJrpS\n366iEi2hRW1oxv8hA2hxa3KSFtnUbZGnLx/EGX9LdEsk7NZ/D4dYUlshVo4g\n++fvY75FHlhhy7jX6BjPQbtoOh8O0YTDfpR0lzByuRuoj2m/F+XKrCKiH37h\nXhhlgngFYmGOVSelI6Nclf18pof5oSxMdIsQSUXQR7uiOggk7gmg1VNYSrNn\noZYVgHXkx+Y/6ucwYlq2nCtXpWfHisqi0BL5O2dl5SgPzuWJlN6Gr423My1z\ns4aLok95mQxa6TPAau2bCaezmvoN5tTz5L/z/qXZGowuSxzL+IRw51WggDhP\nQDd7bMwt+25z1742SdILZP3F53GPfpsreizZbwFvQ+K19LkIn6PTemZIzpPa\npyJp\r\n=aiS7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3w9M8eDRXAqEBiA6HREagBl26P74YypkIyMjTWoLb+wIgcjdYOlOUVFu9P6CJhRwF7d+k/b6RPR+QPKsCAvuiPEw="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.5.0_1563187009930_0.738182416350937"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.5.1-rc.0":{"name":"redux-model-ts","version":"3.5.1-rc.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | Class |\n| TS support | Normal | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nForward to repository: [redux-model-ts-demo](https://github.com/fwh1990/redux-model-ts-demo)\n\n![](https://github.com/fwh1990/misc/blob/master/redux-model-ts.gif?raw=true)\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.foo);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.5.1-rc.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-we2db7JlRYP9aGJCzvro6QwXU338DFVVS01KM/BUZMXQ0fE/zRwn25j/8gCRcCQjyoFlCHpalYunFHqdbAY/7A==","shasum":"ad6f0412078dced2ea751edcc9ee496efae05975","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.5.1-rc.0.tgz","fileCount":15,"unpackedSize":52546,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLUFWCRA9TVsSAnZWagAALq4P/iVXrWFLui/lpm7bjPZP\nKX/zizt242StQwKPrwj+Ii8Dnzg2fNVQWgHnbKvmYhJWmJgpoMvqndcuUUOx\n12FlNEKreP5KxXsqsmH8MGoQ2ZMoJqxh4xf1fc8uVcgVP5HmVxGFhXAS9rGF\nGoJWJKS+TopR6vD79VQ+blChDuMWePUIHb1MDpoi4E4qEJtpjB2RRgYCWDgg\njb/59JZ+CA9jQeqRHIjHLo109IpA9A27AYO0DKIhHgXqffUdODyKGbCo6lfp\nGde/RQj9fMT0wbVuJpJFX8r8qNCK1ny+tYmovqRAwtR8ECtIidSnIApx7VqS\nRkyviDNFS+pLE0MPP7BddSS0byLeN4j9NpyHdXLUoNz2SgCRYsxhS3Ci1EdJ\nPeGfNev5C0IAknFfjxID1855L1ywrkrFDEVS4aK61ZczmS+KhtPXMDyhdqZy\nRWCUSMXUvMjJGOmdbP+CaM3VTDWLy+u9fq4kj7TamUgp3c3BDaaKRD5Y1c/I\ni/FST/5/MsfGmj+t/Z77ZZ/+RoQmKfZyVU9vw+Br6Mpq7zTIiIoZ+5RaE61r\nRqO6YXK6YhfmFGts1aM6dyK6uS0IhCUfWu6c7THsyURiij5hpUFbuAQ4kyjz\n6TZeTORixWzU0b2oS84sALWMjFKCK59lsfbMHNYbwKrNZPz9zwZDswcQJcGk\nW1V3\r\n=ZW6z\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzr/Qi0bNs0ZX2IlGOEf6FnUVvDAn9wD2ZWXI0xCzSfAIhAKz/7vc+WbkkqV8t0L5QcGk9SimiD12+DhWSi7Ky/2us"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.5.1-rc.0_1563246934030_0.6373533226177985"},"_hasShrinkwrap":false},"3.5.1-rc.1":{"name":"redux-model-ts","version":"3.5.1-rc.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | Class |\n| TS support | Normal | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nForward to repository: [redux-model-ts-demo](https://github.com/fwh1990/redux-model-ts-demo)\n\n![](https://github.com/fwh1990/misc/blob/master/redux-model-ts.gif?raw=true)\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.foo);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `subscribers()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected subscribers(): RM.Subscriber<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.5.1-rc.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-Ld6/rMyDeBX63CpSPraiVEYjxKBQjUSPPRpnnOl+/kq0Ve3qWmVp03w/NvcNeJJYBMK1v9xkrtExwbEHeWXrLQ==","shasum":"e5e321aae6713865f75da0baeefa4a901a947c12","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.5.1-rc.1.tgz","fileCount":15,"unpackedSize":52544,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLUUVCRA9TVsSAnZWagAAVaUP/2v0GkrIcJoFUSh5LzoU\n9cuTkxGfi4AkEYEavc9qMpjrum6h99R3wTkM20Jkruxp9HvRVMwvbx8/ZH8Q\nVDeirwsadArL8G1ovrHdphVvUvbUoLI2dHKXaVRPCWJtVt+Hn08C6KckM1Bd\nMMPiFxVS3mGqpfsmWKKK/yTC+Exqq1535VtpQr58KE43devv4EK3DFekbRHT\nZZPPj0dIxlSP90kER3iaq83S8THrChCMNJOQkTiXwuK+PkiEQm5sRA9D6QAr\nihbRY+/jQ69A+PsrRpTCdTwdAHMnp6dyriPgvsMS5u8Qbjq5+aZxCDn/QPrT\n0szeL44f0fe92dsIThJQ20tZVAvntvl7/WiC27YBe5NOM8YR0C85cyektPrG\nc0Le82p/xMBkiNcjFoSo9FpIVzmKnXR3SgHXL/NwueE4u5F51mNSdySaOjoA\nKsVWegnSbSprLTy0P5/L+GZItPDxqEHe4BgjYOB8uNM30mVeddJ2sWwJ9jeh\nuXue2qfKwrdGWXpb6HIPnDy4hL2T1PrKhAiczNmzzld1yM+w1Lv7Uw1NEvL9\nFSUS4MjPH4re2jRf0RVIpCJBm95gT/AUydy8mmew19ygma2i/BisQQRucY8T\nEHpbOwO3k2hIhV4ozRzRupPaUvnt8gdO6nttMsD1pqAv7MO6Joo1x9PcCl7z\n7j4W\r\n=fqTI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcoU5WmiQNnPdK85mvdyRrKjsryGZ31pdK4dl9m8QlygIhAMHKCgnR78OcFoyMpgWZvfMlpT9Ni/FPtxW02wVoNeIi"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.5.1-rc.1_1563247893118_0.3008091474945831"},"_hasShrinkwrap":false},"3.5.1":{"name":"redux-model-ts","version":"3.5.1","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.5.1","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-xSXm7gGsW9j6FL9B40V9m6vHHf/6SLA3Nnzxuy1tfEYKKrPE4F58g8PsVLJ+jv8AHBAPm/sATvhdxoCDDE/pvw==","shasum":"1a9487d62ea222981e27da85e011fe950962f0b5","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.5.1.tgz","fileCount":15,"unpackedSize":52539,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLUXwCRA9TVsSAnZWagAArLwP/19rIEzRWYUY1u88ERFe\nKMGLv+UWdkDfdT8RTtiyBrqxs+gbB4iA3i5y1eyWInJh6TP6/DgU4mlVCWxp\nsh16+BDLmTmogmO35/T7PgQPcTr4IScFQQGGQZr7DdjZ5nFAUbX9tTcZT4yV\n3zek9kPGCRp5V3JMs0K1EcaJZbdVRduXFmqtb4pR7j3kmQRGfuW9cIVB3wfF\nA7Cvj5QLnmVo8PeT3UBhZWsLqN6BBDY6aSCKD1FaJlIRr8KiIjagPBYGyhVO\ncsCV1bDYmfwTBVr67lyAJUJW9fnjcVimx2Tmb+yNZehN4hj6phdHktaFapFu\nBlIc0y8Dqlpuw8EeJMgTApRzIJA+oRiyxb8bGRZ//VWcfwdqoOP2N9fcXKxw\nW7m1DIWSoiLcUPmAO8X4HuBArTl7L7VHQyiUwA8sKu/bWZWMqAk1QhlP2WuH\npG+gtk+0jpOQF+bTZSeYL7WQ3AYV2KDKF8tp7rwfyXejKfHGKwCE0MAF9LtU\ncN3Q5UVYBGCv/EMw/ZgHD6GEzhP/AyJYx2r9jKdra6ql//q9fsJtzEHZdWzw\nKGGl+kuR7y4of3s23Yllxus3qRiouTaeQYCc8SD72fkHtAbndjWeRSPy0AZs\np8d1rT5sr0gKhZP3AfNKgbqvilmVj8pOiatuQb4nsJHUX2HacW/z4qbBcunU\npXR6\r\n=CT/M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFRivCOqrAaBO7IlZlq4lKw2lQcXZtml2vtMLR60syLgIhALw9QC8Xu+X+06t/gdZncSAvsX+GfzLUms1bbFw8ia3v"}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.5.1_1563248111539_0.8138264878509915"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.5.2":{"name":"redux-model-ts","version":"3.5.2","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.5.2","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-BVAXq6bvpp1KD4UrAVMBNiya8F+j3o4PIklIoAASOPtrC8KlGzJkvxqNjBaF4Ixczy3OMClDCQa+yIlHi++ljA==","shasum":"ce39ea86476cf9b94e354696ab569378de9604c4","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.5.2.tgz","fileCount":15,"unpackedSize":52538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdLYHRCRA9TVsSAnZWagAAHdYP/il0crwJUI+0WjmyonP6\n2RMkuNsdM+N0Dh4KZ9epXQ/OWc/UV8WmDWVKCopujv0shFUxof8iHG9gAwFv\n6VpMHBdqUn4Mk1xaOyVv81L3GCtv+EZGhBk5jn1DFDdz4yvP7y/Br3lmfOX9\nMyIf62e5+zFkEd8R72K/AvDKgY2BsWuHhyN7ARbjiUxor39oosbj3+i3avZI\n5OQM1Il8TtLfHjMaknyXkGhFYYgTjSLSfvcxVoEKuVtGGpf3CioKrQoODgG6\nP8E4pDPN9jtjy/zzWCkiEWxqXfPEIZ8oRSGx2B5zt3X2SQvWDrl7JPZqzE1z\nZJa7P7VFPvTaHBOQ4B1NASioiD8I89OAIJOpuYeFQvDtMBBg4IQlzu5GCeBA\nkb3xguJO3gvXqMzSF+jDHhAm/lR17+CPKLGhXKFuNPV9H7UfbuT1rdzuFKWm\n7gD3oKCGuzwP61XXPR1pUjCIZh8wuzFXbFhJ6pI9rCvQiVsZJA2toLwMj9Z1\ngc8IwrHv3abybVRfr3/VvimBi9vZ+4R5gNtlyDt/fu2IB4zfbb6Odqzd+2Ko\nZH9GHEHvaYff/m/RuOj5xW36MEkYMddLlM8pOCxdFHczCdkWtY7yAokZxpFb\nV8PExtTkftKuSQdDvu0HAzLJQu+/RmnEt58JJVE57qa/w6AOHQ6x5VPYESF6\nS969\r\n=fypn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4+lp2b76DH6qMC6tpHmah4WF/MfqWuu92HCQVU5nZBAiEAswJ24ISskaVHMTLV5D5SF2BwALMcViYtTbKFi9r3Ss4="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.5.2_1563263440610_0.3199272762775862"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."},"3.6.0":{"name":"redux-model-ts","version":"3.6.0","keywords":["redux-model","redux","typescript","react-redux"],"main":"index.js","types":"index.d.ts","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"license":"MIT","scripts":{"start":"cd demo && yarn && node_modules/.bin/webpack-dev-server"},"peerDependencies":{"react-redux":"*","redux":"*"},"dependencies":{"axios":"^0.19.0","tslib":"^1.10.0"},"devDependencies":{"@types/node":"^12.6.1","@types/react-redux":"^7.1.1","@types/webpack-env":"^1.13.9","react-redux":"^7.1.0","redux":"^4.0.2","redux-thunk":"^2.3.0","typescript":"^3.5.3"},"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"homepage":"https://github.com/fwh1990/redux-model-ts#readme","_id":"redux-model-ts@3.6.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.3","_npmUser":{"name":"fwh1990","email":"531362022@qq.com"},"dist":{"integrity":"sha512-M59N0adaUqnN2lMfVDbsQLAXJuMY+w3wh7nLUOs7mLRMhKMVvp/yDtRQrblGYZOHg1z5EVsL5PIkTxvh/Tm5Yw==","shasum":"7cdb7456df0a10fa56c161435f7c88fd6753b927","tarball":"https://registry.npmjs.org/redux-model-ts/-/redux-model-ts-3.6.0.tgz","fileCount":15,"unpackedSize":52524,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdMCSHCRA9TVsSAnZWagAA/+gP/32vko5pvWREuRgSuq6U\no6r2zEzfZygw40D68aUUGJZTwwjlr1BVGMUwagqz+KJPQRwTPWUrDAosn8m+\nkzW51HfitHz1qfoSSJYuLIeylGAbasAGAvBsmm+8UDNgZw/eypodVIhkvNuA\nl1uUUQRZ4v+69fScZpYba7IfQ98uYtH7KqOY9fgB4e+i6FTTs89ZjbUWIKC7\n6fuIaLfnN3vY4GgkcZpG35oEtNYCfqmE8Aqfj56FFgDVHxTrMkcCSP/Bv3Cq\nXnjunfaPFA4ky6twm1ehuQmYGXFdJdgVBAFvEwTaBl8gCB5JH9F9ZFNYk4zJ\nZ7vsxdh6Ffj7oIYNvbOX7ltGCxplm9HUF+QHqFJctD6YfYMuy/W/rOYlxDlj\nHSjTCGwriGaCK93J6on09DoxYNf1n3dx+e8oQLcwKYBprSVrR+NGWt7hhMfx\nwajXTScyZ1ubcOEfmBAYWHv4Y0WUErPMsFDfZ60ftYNZiv2IDgB9D8x95s5c\nojKEM7TboDRpXhRbkuXRMOVaMnJaGvmzE+WGm6GqCfQoLogia2UQjFDLcRhD\n6F1KSsF512Mk2ORrbLoApyZUh4xrDCypjWidMj6GSdPHfivmiZsmG1vDADxP\n2Gfa/T56Ys6i+f+nIqD0ZG81c5dXBFz9A05Nksr8uB9cQ1GTM27BDSkOQky0\nwq6q\r\n=pu7t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBUYvRCkT1tH7l5inxzizJCE0UJiuC5xR0be2TwdaLJqAiBjulCPIwa0SXbvgS7EOIBfic8I0JtXFuQTpf//WI6LbA=="}]},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-model-ts_3.6.0_1563436165997_0.03731622186970096"},"_hasShrinkwrap":false,"deprecated":"Using @redux-model/web instead."}},"time":{"created":"2019-05-15T01:41:32.449Z","0.3.0":"2019-05-15T01:41:32.601Z","modified":"2022-05-15T15:34:03.117Z","0.3.1":"2019-05-15T02:42:01.798Z","0.4.0":"2019-05-15T03:27:59.984Z","0.5.0":"2019-05-15T03:55:18.158Z","0.5.1":"2019-05-15T13:45:36.169Z","0.6.0":"2019-05-31T02:16:03.544Z","0.7.0":"2019-05-31T02:38:10.792Z","0.7.1":"2019-05-31T02:49:46.132Z","0.7.2":"2019-05-31T02:56:54.376Z","0.7.3":"2019-05-31T03:13:49.493Z","0.7.4":"2019-05-31T03:16:55.193Z","0.8.0":"2019-05-31T03:24:27.988Z","0.8.1":"2019-05-31T03:35:39.364Z","0.8.2":"2019-06-20T08:33:50.285Z","1.0.0":"2019-06-26T06:21:46.100Z","1.0.1":"2019-06-26T06:34:32.243Z","1.0.2":"2019-06-26T06:37:55.561Z","1.0.3":"2019-06-26T07:38:41.440Z","1.1.0":"2019-06-26T10:37:23.973Z","1.1.1":"2019-06-26T10:45:09.343Z","1.1.2":"2019-06-26T10:50:29.484Z","1.2.0":"2019-06-26T15:26:57.311Z","1.2.1":"2019-06-26T15:32:23.887Z","1.2.2":"2019-06-26T16:19:31.947Z","1.2.3":"2019-06-26T16:31:25.569Z","1.2.4":"2019-06-26T16:35:23.466Z","2.0.0":"2019-06-27T02:37:50.580Z","2.0.1":"2019-06-27T02:44:07.308Z","2.1.0":"2019-06-27T10:27:23.616Z","2.1.1":"2019-06-27T10:29:32.731Z","2.1.2":"2019-06-27T10:31:28.062Z","2.2.0":"2019-06-28T03:32:13.733Z","2.2.1":"2019-06-28T03:45:17.134Z","2.2.2":"2019-06-28T07:44:22.981Z","2.2.3":"2019-06-28T08:15:51.077Z","2.2.4":"2019-06-28T08:30:24.076Z","2.2.5":"2019-06-28T10:56:36.888Z","2.3.0":"2019-07-03T08:26:46.747Z","2.3.1":"2019-07-03T08:27:47.819Z","3.0.0-rc.1":"2019-07-05T08:51:45.375Z","3.0.0-rc.2":"2019-07-05T09:41:34.892Z","3.0.0-rc.3":"2019-07-05T09:51:28.690Z","3.0.0-rc.4":"2019-07-06T07:36:03.986Z","3.0.0":"2019-07-06T08:43:53.301Z","3.0.1":"2019-07-06T09:34:48.035Z","3.0.2":"2019-07-06T12:42:35.805Z","3.1.0":"2019-07-07T02:41:44.431Z","3.1.1":"2019-07-07T08:25:00.161Z","3.2.0":"2019-07-07T16:15:38.431Z","3.2.1":"2019-07-07T16:19:47.556Z","3.2.2":"2019-07-07T16:30:07.186Z","3.2.3":"2019-07-08T00:33:42.507Z","3.2.4":"2019-07-08T00:48:03.025Z","3.2.5":"2019-07-08T03:38:28.301Z","3.2.6":"2019-07-08T05:20:37.000Z","3.2.7-rc.0":"2019-07-08T08:21:21.108Z","3.2.7-rc.1":"2019-07-08T10:26:15.342Z","3.2.7-rc.2":"2019-07-08T12:11:58.523Z","3.2.7-rc.3":"2019-07-08T12:56:30.978Z","3.3.0":"2019-07-08T13:00:48.691Z","3.4.0":"2019-07-09T03:42:58.231Z","3.4.1-rc.0":"2019-07-09T07:29:41.318Z","3.4.1-rc.1":"2019-07-09T07:40:28.361Z","3.4.1-rc.2":"2019-07-09T07:51:41.186Z","3.4.1-rc.3":"2019-07-09T07:57:23.454Z","3.4.1-rc.4":"2019-07-09T08:22:38.702Z","3.4.1":"2019-07-09T08:30:55.300Z","3.4.2":"2019-07-12T03:01:53.608Z","3.4.3":"2019-07-12T14:49:21.549Z","3.4.4-rc.0":"2019-07-13T08:32:40.604Z","3.4.4-rc.1":"2019-07-13T09:58:01.201Z","3.4.4-rc.2":"2019-07-13T10:45:35.446Z","3.4.4-rc.3":"2019-07-13T11:32:03.225Z","3.4.4-rc.4":"2019-07-13T11:57:50.389Z","3.4.4":"2019-07-13T12:12:45.506Z","3.5.0":"2019-07-15T10:36:50.109Z","3.5.1-rc.0":"2019-07-16T03:15:34.154Z","3.5.1-rc.1":"2019-07-16T03:31:33.246Z","3.5.1":"2019-07-16T03:35:11.731Z","3.5.2":"2019-07-16T07:50:40.766Z","3.6.0":"2019-07-18T07:49:26.187Z"},"maintainers":[{"name":"fwh1990","email":"531362022@qq.com"}],"description":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)","homepage":"https://github.com/fwh1990/redux-model-ts#readme","repository":{"type":"git","url":"git+https://github.com/fwh1990/redux-model-ts.git"},"author":{"name":"范文华","email":"531362022@qq.com"},"bugs":{"url":"https://github.com/fwh1990/redux-model-ts/issues"},"license":"MIT","readme":"[简体中文](https://github.com/fwh1990/redux-model-ts/blob/master/README-cn.md)\n\nHow many people are writing redux in functional way? And how much time you had wasted since you are repeating action,types,reducer.\nNow, I want to tell you, I am in modern way to write redux. I'am using OOP instead of Functional Programming.\n\n# Compare\n|     | Original Redux | redux-model-ts |\n| ----| ---- | ---- |\n| Coding way | Functional | Class |\n| TS support | Normal | Perfect |\n| Split action and reducer file | Yes | No |\n| Define types | Yes | BuiltIn |\n| Sync action | Thunk OR Saga | BuiltIn |\n| Sync loading status | Code in reducer | BuiltIn |\n| Business code size | Large | Half |\n\n-------------------\n\n**You will get 100% Type checking when you are using typescript.**\n\n# Installation\n\n```bash\n# By npm\nnpm install redux-model-ts\nnpm install redux react-redux redux-thunk\n\n# By yarn\nyarn add redux-model-ts\nyarn add redux react-redux redux-thunk\n```\n\nRemember: redux-thunk is not required until you want to use method `actionThunk()`\n\nRemember: Keep react version at **16.8.3+** and react-redux at **7.1.0+** when you are using `React Hooks`\n\n# Run Demo\n\nForward to repository: [redux-model-ts-demo](https://github.com/fwh1990/redux-model-ts-demo)\n\n# Snippets\nSearch plugin `bluewaitor.tsreact` in vscode extension.\n\n![](https://github.com/fwh1990/misc/blob/master/redux-model-ts.gif?raw=true)\n\n# Usage\n\n## Define Model\nYou should define a model before you want to use reducer. As rule, one model can only includes one or zero reducer. Firstly, let's define an interface and initialize the reducer.\n```typescript\n// test.ts\nimport { Model } from 'redux-model-ts';\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n\nexport const test = new Test();\n```\n\nAnd how to strip reducer? You just need to return `null` from method `initReducer()` and remove generic `Data`.\n\n## Register Reducer\nAs we know, the reducer data must be registered to store by `createStore()`, so the model instance has provided a method named `register()` to do that thing.\n```typescript\n// reducers.ts\nimport { combineReducers } from 'redux';\n\nconst reducers = {\n  ...test.register(),\n};\n\nexport const rootReducers = combineReducers(reducers);\n```\n\n## Define Action\nWe only have 3 kind of actions here, but remember that one model can includes unlimited actions. And I will show you how to use them.\n>- Normal Action\n>- Request Action\n>- Thunk Action\n\n## Define Normal Action\nNormal Action is the mostly basic action. It can just send message to reducer.\n\n```typescript\n// test.ts\nclass Test extends Model<Data> {\n  myFirstAction = this.actionNormal({\n    action: (name: string) => {\n      return this.emit({\n        name,\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        foo: 'new name: ' + action.payload.name,\n      };\n    },\n  });\n}\n\nexport const test = new Test();\n```\nThe method `onSuccess()` will change reducer data from this model. But remember that it's an **optional property**, that means you can remove it and this action will never change this model who's reducer data is here any more.\n\nHowever, Action can also effect other model no matter onSuccess is defined or not. I'll show you later.\n\n------------\n\nLet's find out how to use action and reducer data in React Component. As usual, we can inject them by method `connect()`\n```typescript jsx\n// By Connect\nimport React, { FunctionComponent } from 'react';\nimport { connect } from 'react-redux';\nimport { test } from './Test';\n\ntype Props = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps;\n\nconst App: FunctionComponent<Props> = (props) => {\n  const { runAction, name } = props;\n\n  return (\n    <button onClick={() => runAction('New Name')}>\n      Click me: {name}\n    </button>\n  );\n};\n\nconst mapStateToProps = (state) => {\n  return {\n    name: test.connectData(state).foo,\n  };\n};\n\nconst mapDispatchToProps = () => {\n  runAction: test.myFirstAction.action,\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n```\nOnce you click the button, `runAction` will be invoked,\n and `test.reducer` will be modified by the method `onSuccess()` defined in action right now.\n\n----------\nSince React version `>=16.8.3` and react-redux version `>=7.1.0`, you can use hooks to refactor code from above.\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { test } from './Test';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = test.useData((item) => item.foo);\n\n  return (\n    <button onClick={() => dispatch(test.myFirstAction.action('New Name'))}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Define Request Action\nWe are always need to fetch data from api, and there are lots of detail we should deal with. Such as we need to keep loading status before we fetch succeed. Such as we want to alert message when fetch event is success or failure. And so on.\n\nAha, Don't worry about that, I have resolved these already.\n\nWe want to make action as soon as easy to implement, so we just hide the detail things into `middleware`. First of all, you need to create a middleware.\n\n```typescript\nimport { createRequestMiddleware, Model } from 'redux-model-ts';\n\nexport const apiMiddleware = createRequestMiddleware({\n  // Unique name so we can related the sync action.\n  id: Model.middlewareName,\n  // Your base address.\n  baseUrl: 'http://api.xxx.com',\n  // Headers are always necessary.\n  getHeaders: ({ getState }) => {\n    // You are free to get data from redux\n    // Such as access_token like:\n    // const token = tokenModel.connectData(getState()).access_token;\n    return {\n      Authorization: `Bearer token`,\n      Accept: 'application/json',\n     'Content-Type': 'application/json',\n   };\n  },\n  // Collect your meta.\n  onFail: (error: RM.HttpError, transform) => {\n    const { data } = error.response;\n\n    transform.businessCode = data ? data.code : undefined;\n    transform.errorMessage = (data && data.message) || error.message;\n  },\n  // The behavior when action.successText is set.\n  onShowSuccess: (successText) => {\n    console.log(successText);\n  },\n  // The behavior when api respond error http status.\n  // You can set action.hideError=false to stop invoking this method.\n  onShowError: (errorMessage) => {\n    console.error(errorMessage);\n  },\n});\n```\nAnd then inject this middleware into store.\n\n```typescript\n// middlewares.ts\nimport { createStore, compose, applyMiddleware } from 'redux';\nimport { apiMiddleware } from './apiMiddleware.ts';\nimport { rootReducers } from './reducers.ts';\n\nconst store = createStore(\n  rootReducers,\n  {},\n  compose(applyMiddleware(apiMiddleware)),\n);\n```\n----------------\nAll right. You get everything ready and let's go on.\n\n```typescript\n// profile.ts\ninterface Data {\n  id: number;\n  name: string;\n}\n\nclass ProfileModel extends Model<Data> {\n  manage = this.actionRequest({\n    action: (id: number) => {\n      return this.get({\n        uri: '/test/api',\n        query: {\n          id: page,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return action.response;\n    },\n  });\n\n  edit = this.actionRequest({\n    action: (id: number, name: string) => {\n      return this.put({\n        uri: `/test/api/${id}`,\n        body: {\n          name: name,\n        },\n        payload: {\n          name: name,\n        },\n        successText: 'Your profile is updated',\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        name: action.payload.name,\n      };\n    },\n  });\n\n  protected initReducer(): Data {\n    return {\n      id: 0,\n      name: '',\n    };\n  }\n}\n\nexport const profileModel = new ProfileModel();\n```\n\nWe define two Request Action in this model. And there are more property we can use.\n\n**uri**&nbsp;&nbsp;[string] `required`\n<br>\nThe relative url.\n<br><br>\n**query**&nbsp;&nbsp;[object]\n<br>\nQuery string that will merge into url.\n<br><br>\n**body**&nbsp;&nbsp;[object]\n<br>\nThe stream data，It only works for `post put patch delete`.\n<br><br>\n**payload**&nbsp;&nbsp;[object]\n<br>\nExtra params for reducer.\n<br><br>\n**hideError**&nbsp;&nbsp;[boolean | (response) => boolean]\n<br>\nDecide show or hide error message when fetch fail. The default value is false.\n<br><br>\n**successText**&nbsp;&nbsp;[string]\n<br>\nSuccess message you want to show in screen when fetch succeed.\n\n## Define Thunk Action\nI suppose you understand what is [Redux Thunk](https://github.com/reduxjs/redux-thunk), and you have put `thunk middleware` into store. And then, let's go on.\n```typescript\n// test.ts\nimport { profileModel } from './ProfileModel.ts';\n\nclass Test extends Model {\n  myFirstAction = this.actionNormal(...);\n\n  /////////////////////////////////\n  /// Usage: test.myThunk();   ///\n  ////////////////////////////////\n  myThunk = this.actionThunk((/* Action parameters here */) => {\n    return (dispatch, getState) => {\n      dispatch(this.myFirstAction.action());\n      dispatch(profileModel.manage.action());\n      ...\n    };\n  });\n}\n\nexport const test = new Test();\n```\n\n## Model effects.\nIn some case, We expect the action can effect reducer from owner model but also other model. Yep, you can override protected method `effects()` and receive effect from other model.\n```typescript\nclass BarModel extends Model {\n  reset = this.action.actionNormal(...);\n  request = this.action.actionRequest(...);\n}\n\nconst barModel = new BarModel();\n\n// --------\n\ninterface Data {\n  foo: string;\n}\n\nclass Test extends Model<Data> {\n  protected effects(): RM.Effects<Data> {\n    return [\n      barModel.reset.onSuccess((state, action) => {\n        return {\n          foo: 'Oops, reset',\n        };\n      }),\n      barModel.request.onSuccess((state, action) => {\n        return {\n          foo: action.response.name,\n        };\n      }),\n      barModel.request.onFail((state, action) => {\n        return {\n          foo: 'reset again',\n        };\n      }),\n    ];\n  }\n\n  protected initReducer(): Data {\n    return {\n      foo: 'init',\n    };\n  }\n}\n```\nFor Normal Action, it only use `model.action.onSuccess(fn)` to change data for other model.\n\nFor Request Action, it can use `onPrepare(fn)` `onSuccess(fn)` and `onFail(fn)` to subscriber action effect.\n\n## Request Action Promise\nWe can use `promise` in React Component when Request Action is invoked. It's very cool, because of 100% type checking.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const handleClick = () => {\n    dispatch(profileModel.manage.action(1))\n      .promise\n      .then(({ response }) => {\n        console.log('Hello, ' + response.name);\n      })\n      .catch(() => {\n        console.warn('What is wrong?');\n      })\n      .finally(() => {\n        console.log('Wow, cool bro.');\n      });\n  };\n\n  return (\n    <button onClick={this.handleClick}>\n      Click me: {name}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n## Request Action Loading\nEach Request Action has loading status itself. Feel free to use it whenever you want.\n\n```typescript jsx\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  // It's boolean type.\n  const loading = profileModel.manage.useLoading();\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(1))}>\n      Click me: {name} {loading ? 'Waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\nYou can inject loading into props by `connect()` if you don't like hooks.\n\n```typescript\nconst mapStateToProps = (state) => {\n  loading: profileModel.manage.connectLoading(state),\n};\n\nexport default(mapStateToProps)(App);\n```\n\n------------------\nSometimes, you may have to show multiple loading status at the same time. In this case, we provide a property `meta` for Request Action.\n\n```typescript\nclass Profile extends Model {\n  someAction = this.actionRequest({\n    action: (id: number, data: any) => {\n      return this.post({\n        uri: '/profile/api',\n        body: data,\n        payload: {\n          idKey: id,\n        },\n      });\n    },\n    meta: 'idKey',\n  });\n}\n```\nRemember: Make sure the value of meta can be found in key of payload.\n\nLet me show usage in react component.\n```typescript\n// By React Hooks\nimport React, { FunctionComponent } from 'react';\nimport { useDispatch } from 'react-redux';\nimport { profileModel } from './ProfileModel.ts';\n\nconst App: FunctionComponent = (props) => {\n  const dispatch = useDispatch();\n  const name = profileModel.useData((item) => item.name);\n  const userId = 1;\n  const secondUserId = 2;\n  const loading = profileModel.manage.useLoading(userId);\n  const secondLoading = profileModel.manage.useLoading(secondUserId);\n\n  return (\n    <button onClick={() => dispatch(profileModel.manage.action(userId))}>\n      Click me: {name}\n      {loading ? 'Waiting...' : ''}\n      {secondLoading ? 'Second waiting...' : ''}\n    </button>\n  );\n};\n\nexport default App;\n```\n\n\n## Generics\nRequest Action is enable to inject generic `Response` and `Payload`. Remember that you only need to inject once, and the whole project will enjoin type checking where code is related with this action.\n```typescript\nimport { Model } from 'redux-model-ts';\n\ntype Data = Array<{\n  id: number;\n  name: string;\n}>;\n\ninterface Response {\n  id: number;\n  name: string;\n}\n\ninterface Payload {\n  id: number;\n}\n\nclass Profile extends Model<Data> {\n  getProfile = this.actionRequest({\n    action: (id: number) => {\n      // Inject here\n      return this.get<Response, Payload>({\n        uri: `/profile/api/${id}`,\n        payload: {\n          id: id,\n        },\n      });\n    },\n    onSuccess: (state, action) => {\n      return {\n        ...state,\n        [action.payload.id]: action.response,\n      };\n    },\n  });\n}\n```\n\n\n--------------------\nCool package.\n\nFeel free to use this package, and you are welcome to create issue and send me PR.\n","readmeFilename":"README.md","keywords":["redux-model","redux","typescript","react-redux"]}