{"_id":"redux-adapter","_rev":"26-567652dd99b14aa3a60338cacfe5e35d","name":"redux-adapter","dist-tags":{"latest":"0.0.4","prerelease":"0.0.5-0"},"versions":{"1.1.1":{"name":"redux-adapter","version":"1.1.1","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile --copy-files && standard-version && git push --follow-tags origin master && npm publish","transpile":"babel src -d dist"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","peerDependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","webpack":"^4.16.2","webpack-cli":"^3.1.0"},"gitHead":"157788b7b9bbd7def7c3e03cb55a051b78fdfc5f","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@1.1.1","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-PjrqqqzHYZ7G7+8/TwqPubysmjp4qWBcmUe+Xoy9WIqecQKPPD1eo6VoaJ3+B0Ovi5gPjwIxcjMXrVM+H+DpRQ==","shasum":"a2b59f6734372c68a398b1a1fc129dcad6e8c28e","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-1.1.1.tgz","fileCount":13,"unpackedSize":18765,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWANxCRA9TVsSAnZWagAAF6cQAIhuotFR9u8i90NSyR7Q\n5sDCUy+22gbZXnC0npLe530sMXGWYYWwBtg11MLN7bnwApweWWsCPP6Wu9da\nSAqXvdtlgZd/3bQ+kAARK+2pL2NtYJjj7cJfXVLsm/lrf1G5v1xwjvIbQbyp\nyE6ds+C3csSj3uRdMHkxB3CqivpG2fI5B7gESpfUQJDggRJwhSH2xUC7q3Cl\nrLZ/9OY4egPY6WjFaMrgF24DXAUHZEbKEjn89wHCQ7LtrWAW9jbFldEIblvW\nqv1IGedqZ5yRHlru8aVFb9OCsCP4VRZsq1L19c3x0T/p52RNr6Ubv48Z+GMt\nbDTk8ph5qcAXnhUYPtotBpPEQ2wXW1a9dbD213UsISIj6TTuRCuRjkg1LAWa\n1D1DyOmeOLFNxAfkvnQNOnY0jvcY/JJr29PimDSV08w4zmz9obPF4Hb83Ie5\n7nE54Cz3HGvYA4YBUvbqVFFVy2Ee0nC8TbDIQTLdXSqk6dfd1MtzOEWA6flg\nakv3WwIOOCO/t9YR81o1MD1I3q0gHEA7tEYf/mBDO/BkbDZnwonuDtnQ6C4S\ncLSieQgja7o4ShX1oRJTdLQJl4wOE2vtxuagFRRHg6tjPty38ig7yD+2zp9N\nlgjIGMCFDVmMu+nFAZcvE74shif5Sl0bi0bTKlcCgse56yJespwcCih6qUDE\n9z7D\r\n=4t92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICofbucv0N72PY7S1fOWf5LUienog6n2n+LBM3LMVbMAAiEAoCb8FjJ54Z/C/7vU4SEi9Q3RbVf2vMGWQWhqVxDCQb8="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_1.1.1_1532494705696_0.4439992739706873"},"_hasShrinkwrap":false},"0.0.1-0":{"name":"redux-adapter","version":"0.0.1-0","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && git push --follow-tags origin master && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","peerDependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","webpack":"^4.16.2","webpack-cli":"^3.1.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"9680aa32213212fee9c6763366b945bc66b7a8f4","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-0","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-a73hov5wlBlxzD2ZvzlYQQ0dtmEdKU7OB614TwnIUOBNRL0G4OYWD1Q2igPksw1lIG9wgm5R93YriqxylgyH7A==","shasum":"57b0d277f6936cfe47e608b73c83a4550f9c29c9","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-0.tgz","fileCount":13,"unpackedSize":19236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWATUCRA9TVsSAnZWagAAE74P/3VoC28aZ7UuoQdcPWyw\nnCJUn8hYaa0flNvdRjRRNse+jrcVUNdyzIg3ytrx9TsA8k9ARt5nV3Y1AZrC\n7bNAsO7x95dGhVF3K5QlmHtf3SgnUijKaYOAUHAnA9LKU5nQCEPng/dxPS9m\nTY/e1Rd6gUsFXUDlz+QlGJFBf1c2DHNA8WoaDIwwXungfpobugs4C5MnwCYK\n3hMxo+U30XcBtpsDrfrZNA3RGuSnantHK9cmTsuSaGJUzv1AXrPdskV5lZbE\nRYi9cXf642wItDpYfrlw9MFGY3RZcCf8b0jOwKeQBIfHrKlwUZjomrPyekab\nuSPGqiIB6AYsHLTfotZ0rN5rGjmlicGkgMqRlu2ljOb8tVZ9h3I5h37Gnins\n2EK8oLcqzo+YW+iu12salvgoFCt7brWvx1zOs2daOdDyLyAmzmCJCxqpYp5w\nUQvpZBrnD8L7aItZfMaoK1GLuYinPtIFkftyLYMOCoU2pEM5leWexjVYzE30\nIej3JW7ombSTMCa7ymZVOVXK3Uxvq/KYGr2oQHQH8cYvgMsAELceWd2NdUU/\nNEtdcYRWe5y0ijyQeIkjHLoLIwrKtZeSoikpORnSPGcr2YbWi0kSo1K6YJ7E\nTGWkn4GFdKK1R9DP00ljERB/Gmn+s/WiQtpDHhJ4h34Gbjvo60ps+DZ4Xxbl\nabSS\r\n=7dcW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID5pPwwm9yYGryFKvLgvzEi3idc/05LeaZmpUmCjwkqhAiEA0zBDSz/T6JFDMalvTfDDaVGlAGLmMD3M4tgGxtVtaE4="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-0_1532495059615_0.2784949887842687"},"_hasShrinkwrap":false},"0.0.1-1":{"name":"redux-adapter","version":"0.0.1-1","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && git push --follow-tags origin master && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","peerDependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","webpack":"^4.16.2","webpack-cli":"^3.1.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"3bb922e8e42f25505ba5b42affd2922c705e88d2","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-1","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-e+H2hSjFJAb+97jcYJOPk6AHLyUEKXIXf/0pAbRnPIhkmeztvbUq2+ItGwQT4jWlK307/zSUWhWwY77YR9qm5g==","shasum":"b54a45519a48cbb2a75fc140e62ba6bcd9ce92f3","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-1.tgz","fileCount":13,"unpackedSize":19369,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWAbJCRA9TVsSAnZWagAASI8P/1uDEIXhIGmSh+eiZup3\nfamG7hJAW9gnjVbYCKDP/3SMODDGHo4dNt+2koSquB3pSuN85iDXopNA9GvN\nDCfmsfdoSvwv/tz5LnYBRG513NAPf0PWyZyutfFfZEWLZuL0bF/lb01mKD0m\nKjfIVL1Ri8aPApZFCNPIQiE5HU8Q0Wa7xtpfYj8NI7N5Rs+N31VhrLZcjspf\nnSABHnGSEpRdawVvb8BvO161OYGMhwkwqBRX84hPogFzvwKPfdqOuDim1PO0\nuHi7pbMIw7uqRNlbuSvvuH37tSJooHh7FcUDxLYzv/dVCa+nZL+jqXK+rqYM\nU7jI59XnGr8uBNI+vCjVuqPRQ1dHWHfB+07kBSIN4sZjJ8nAXVNYwbuet+8H\nb0aqIVWaH/tNxdZ1Jdpduv/FgiP2pSj6q0aeOk2zkz0uK48ddKxhjRax6Arw\nCCM+Wpu+MOkMkSdlWUfKuqdm93dp/4zYGRhHnd3WC7lnKG0qLFYV5EpkcoFg\n4qvReRmt1K3sI4bYZnRBSmpVPtTul9z7Sej7Q3Wj8xAplCmBr9U7vRnUI6zx\n+cgXA6qqBwOKPq9FLLmM5Cq0jnWEpmUzaxahYyLGzF9IQX/fqItVMOmyG+MI\nG/4+FtYeoK/8Ji6qUuVl5C27fzs7iWUiUbqrzT79DBldYai9pN1TpWgxxSEO\n+KXV\r\n=ZVi7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEJfH2M93znZXIGGPwvVZ2bX721BLEn22K34QCH7xYY+AiEAnC3gAm/F2R8vevHCn9B4qodFmtppVJE5C76GBfMyDfo="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-1_1532495561104_0.3808816644886348"},"_hasShrinkwrap":false},"0.0.1-2":{"name":"redux-adapter","version":"0.0.1-2","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","peerDependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","webpack":"^4.16.2","webpack-cli":"^3.1.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"3b322d8df7358652bffd2592454d793426ffd1b5","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-2","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-zT6heWqhukqSwxGffOXRK+UF/s4E3ElkvvjLrXt70/UAWhBiUxkOiWM9yF3USqiIfqX7ZTRUAdhjNajc8vseKw==","shasum":"9562c42ba579160079083a50381e38015b351cc6","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-2.tgz","fileCount":13,"unpackedSize":19464,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWAuvCRA9TVsSAnZWagAAlgsP/198i/i+KPU8lspFr3Iy\na659vwpRM88bsGaKC//V3+BRRrrr6ptqT6ayiIcJ6mqIN0E9JgwIZltR7M5P\nfYHTPKHBMdgrQzSKb7UHO18TzHyfyL27j+/PXqQW77RrRjELQeDtXlPOlLBv\nzHKrCif19TblLcqxj8DLgtmu7BaN4Dm7/ReCBMkzkCtSajHXOAL/d1PzXQM+\nEO4J2ILYna6e4T6PO1hG1Y2JzbnftkvQ+DqZlPL4ODsMXVO9IYx7O564Tn2e\ngTfxFAgFdLqGXfOjS1ABvki+8KfUNOyZWSPawKBNJAmMUa0AN+fbaD468dFa\nSMg62nOlnVhVL8prioGUQBmdgFDHx1JsHmW+oKkRolUF28uUAlIe6/kJ1leJ\nXRLNQxprETn43Q7VT/Cnt1KexMjuCbfK+ZmbdQEmuHPEhmjdVGd8blYt8kTx\nfVfipydLEJYcl8l4SUZsXoNhLHEqVYXvL1mi0jX6fMbdHOIaSpWAoVxTvcW4\nMPeJulHRG/g9tkXfNRSVAPxMXCAG3wAgOfQFPzmEBKlLD/bkH0e+2orCr1Ok\nf19RbAxErvr44bRsE+sbzdyt+v/PWCIcWRSA+TVUMe4Gc50a7cDqpzdTTbDW\nL4m8PvEZMBonDUVNqXZxvabFzjS4MvFFHZ5G7c0g886u1BdBQNgGYnLCOz/D\nXa3c\r\n=lyER\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUudw9SupDQIBeVKj8Q5tygq1B8RiEUdjwNa3vDifDQAiBQhdTVTtwzKv5yqh36cwHSxn8FhUf9H6Btzek2P819Ew=="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-2_1532496815688_0.7647555782217594"},"_hasShrinkwrap":false},"0.0.1-3":{"name":"redux-adapter","version":"0.0.1-3","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","peerDependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"512429aa269419bac493ce670b0bddd70babcbe2","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-3","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-8BZr2EeXryD7No4ry+2UENt02ksmokfv7HSOiDc2Cl1xM75+5yCPGxRcD1V47glz0skhN3VsU3XE1EXxulei4g==","shasum":"d50b6a80360c98ece16dca0c4e80cff5b1e47f73","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-3.tgz","fileCount":14,"unpackedSize":20008,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWBYfCRA9TVsSAnZWagAAeeYP+wRMDAQrIn+5Lr96ksDg\n+IV8NlerdXR2xd2kwwdQrnyS9sgp3zXfSbkBWo/qnFsiW+iqScmAMFccr28U\n8SQ7YNVdswU/4gCDbsKb9bVJz6p4VuKT3v/Sjka3bFp9iLXcqbWUKz4t9wGo\ntOM+98/9A6G5f/E6HURRoIGPBSCZVqzBGPr3gstyjiOhbp4T0+itWgzs/0Eq\nXFrVfQCYLAED3eD9XswM/hHehvPVCAiCs8YX7KrzSz+L+kxug8NFDhwF9h2Z\nVf8FHK7erWU1nif5CGtmpDz3Dn/43TJHXYqdcErFBbpJnrVzCcYtSsmuMfB5\nQokafaR4hZ7aiDR1k99LGg46gGK68mUix0Syq5l65YSrMQZ1Y9n1CbHPudp7\nmM8XJ07S4nUqMVvsS/dffdgWMEwHeTEwvWFRpmJHff4fGz9y6ztzxYv9gdQW\nZhzh4peLQb0ZMn0Ge9Lx5XWZ7YuIWCdiKMCLP5IQsM5bd3NmcZh10Hd9oBi2\nnjZRhFQzbNaqfJNGEJaDsxHq6h1yfQPR9fL4fmvLmUbgCpXSyHGw+lV6NUHF\nGr4oiSZPCDIeu7WC9OfpHzqOjd2Iu5ZyE3lTkZHvwRdvKS3EAjc+HoJroHcZ\nX9pHQP+f1wRGZSLCf1qb2MzZ3+tCdG7EiXu5oW78H8xwno2tlFtS+miYEVeI\nL0TL\r\n=ErbO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmVYTZMU4629Li04pfnmWVOzE+REcxz2qxMUuuOfc/owIgLJPLks+wmnEwBbrK2wUsezQd3a09PYLox8/HRsZRBgM="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-3_1532499487006_0.7790344545628947"},"_hasShrinkwrap":false},"0.0.1-4":{"name":"redux-adapter","version":"0.0.1-4","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"efa9b176c280e12dbc1d9b50a328c0561b59dc83","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-4","_npmVersion":"6.1.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-wm0OTqEtAc8Bng3LFXA165uHYhqjB0hLcrRx1UFO202pj6YF9adhoKPMCyN5Cnb5CKzVLqNJZkRez7aLTvj1IQ==","shasum":"b2660bd1e9004c54c932738197df80648966eeff","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-4.tgz","fileCount":14,"unpackedSize":20129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWBkjCRA9TVsSAnZWagAA4kwP+wYOObKFe/3k05CM4wm/\nL9ecesatyZINdNUs5yJr3Kf5FGcByj/FJyK8uplWijJdD/uYV/1oZ6kt7xlw\nJtmGrg3ITjP0Oo+d9XOHCMe2F1EVi6nlXyxfhsalTBAzagUFHA/ylsIB2WfQ\nkFBUTL64J4ax2Tyy8/CTpSXo7l1+3hofO/FQR+HCD3XC2sG/A3FA+E0lqjDt\nasCGYf5t0Wm5tbQbDkNXTIueGWKbNYc4WBHp7pUCTWUfpk+HMkjM0Xu/r+UQ\nUZ80zKxmRk5e1sBn6KcYA1W+foaz14SIMUl3S5TVmUWmN996WiixVgS1SQra\nUuGthROs8WS6X8Q/NdeD2Tq3YaIQCpzXs917DUgPkZggoXR4SsO25XiFS4Wk\nyQVKoAs9nTXdc4pcSveS92gu64+pOlVkrwHKnS0UYl2Uy18C9FCc6D8NL9FL\n7wmKixrArAUwKZDOV6/mze5QZdi8J0zroyfR7HRYtfnXZIG+fxGOZzkorSg7\ng8O40avl+KxVJT+WjvAVcL7wdGGtlrECCkVzU4zTQO0QxaDD9QKAmvN3aMU6\nOQcn4jpmP2yb8JKBI4JMb+jkwe1vMmOz1hkjvQLhlj5Eh1no9ruiH7zR/94K\n5yh1ZwnxeqKifnDraM5hJQ2osbLvHutBU0N6FeoFE725ppFD2/dgGi4iU+5m\noWNp\r\n=pihA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHrkhOpD/yeN2vvKvojvnd1iIrPOdIKzw4Um/0AH00DMAiEA0Pd5mUERQ/EGQnmEvxGy5DCOYcEd+4GMbkbItLTMoRc="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-4_1532500259344_0.14308704295428454"},"_hasShrinkwrap":false},"0.0.1-5":{"name":"redux-adapter","version":"0.0.1-5","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"774818b11355df6c7f94df8b12bcab333b051fae","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-5","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-oKfCt/UmpHm7RGiOCRB60yL0my0nyRbsUzojDTFWjDq+nsJyl5CE/5Ur5abbmXb02eMHKQhByqz4J18jg2TyiQ==","shasum":"8e617f142c240bd8c042b5d5063899ffe7bc297d","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-5.tgz","fileCount":14,"unpackedSize":20271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWDRBCRA9TVsSAnZWagAA54IQAJDx0i99VH5YoNZHFSnu\nx6oz9mmYvo5vjTNlApSkcyFSPQvrVRoZr98UxrBhSPF7AqjzpJt4OiY9+mfm\nJxv76dGC94rnYRibIF0LzX2YCE4881DMe/hFTkbLrbAZL5tiTR4CX+Q0T4tC\nxVgaMx5ScgvmW4SNPtpKW1iYs5q7QUXeykBznoijLahGu8eED+0Eg5XM6hK9\niSNz4k2DLLBA6oYKOZ4SUMOcFxSD4bPOuvDlocoPuSyTn+VP0l3CDWyWG2Ky\n+aPir4C7CywQASALCE/4hRAFWbZdMabmRtBJyrQ5Pi1ewpnoYjQ3FN5C21Fi\nu+Rw8ySfVfFRzfuzl0dp1EFBrExG6ID529MdTjRb26UqtPcKZScIrBgU2Xf7\nkNLaP6DTK1Qu8TcImD8pGH9U7tEQilCH6GPkssg+N1b3WaWvEd1Hax0djg/g\nqPBSufdU1jzDzMH6x2rtCsNlfa+h3rjeG5lZVoduePwQHtM705sVw/mJE2Ds\nH/g7YWKW9JXXfN9zyMIQhJHz3/PmOMZx2v/SffO1luhDzYtld3hNqdhXdabu\nsdO/rsCdOhJ/1L571CQvZE4snDkNMgOmfC9vNqQklK33m0URM9l5RwBSnLxE\noVV+FApP+aAUmbtwth54zF6LKsDDqYDCz7rbOL24ScumLMKXizJFVKR8PETf\ntNHs\r\n=WpLU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcguEK47DegMCjSfLHlTodMYqoWokXpzEggXlK4PPHOAIhAImsc9ASIugThvULoIhosuS7Ka+al0iU1AZnCfXQ2ddM"}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-5_1532507201722_0.02348403944810995"},"_hasShrinkwrap":false},"0.0.1-6":{"name":"redux-adapter","version":"0.0.1-6","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"dc04734a3c0fa449902db42556610cd970f0961e","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-6","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-xfQ8RSLh9T1nrmUr12yvqT5UZEHUoeavTR21yP6Qr6d1yFmCR5BGcYvHODenzmuMANmI1nWp4u+x+jbWgBrnqw==","shasum":"b6c7081553365fd3057d3e76ffa7bf8a4d357625","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-6.tgz","fileCount":14,"unpackedSize":20365,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWDsnCRA9TVsSAnZWagAAvBkP/0kl7bSHEj9RYt/MRHs7\npdtzxSaJoGnCa+z+9tofKm99gWuaYduSaPC73v1FO4FODUvvnCjaDNpWYeQJ\nF7VlKjbBZeUt9/Bqqi0+LlRUH592ASKCjZRISEuAD5C27PjiMoXCgc/+WFIg\nI9QL+yDjs6mKVzKLUUnqn/Jjcbcm5PeFfFxDL+EXKrjzaMDE+kggeBPKt7x7\nnSe6gwuaCXYZo36TbjN6VLKgQPlriIxiuFKiB8LfDHX3SBn5onpGSn4iURAX\nxulFyellDRQhd+feltU+vi1V4tOQfuRDl2bEK9yXacQxK8mQOtjMhzcmvfiO\nCgXmlo61zk/vQhSk6mPZrGa3CDCYjq7E9nKsoRv1RTiUkkotCa9PZ91oBXNK\nNXKGn8gjgokRu+63YF0ZvJ7mrL4kkPO3RM+jVhCqBmtzVFTlheObZgVB8FQ0\nbLjhm3QllcxWtq3KdF9JXHRs5RczkS4COWOyDP+VAGaiqDmpEAgp9Vn8Rpze\nuc1YbX597lcet+GD90cazlG1hmoGQ6njzDIKsWO1Ry1Z/2x4gJAbEsYe92Vz\ncuW26+91EhkWKEmWl53swf6x8t8/oUNoNzp4i08wDKg0rbIokf1cCJ9l9Ow4\nNG92MirPtNhaC7WBJLHMMJkOl5HGDHMKmtR+bq+Z/DbwEc6SAt2XHysgl5aQ\nEKw3\r\n=fAKl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEDZpNaMTtFlKLzf9HxfGcyou+fSY9NwIFd3npcEvi1SAiABIQg6xpbANRtdy8BClo8FgLgjeqRuSkCxwjNLaG0ODg=="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-6_1532508967178_0.34541603523444153"},"_hasShrinkwrap":false},"0.0.1-7":{"name":"redux-adapter","version":"0.0.1-7","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"2bff726eadba58411335331540ed4bb0a940ffb6","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-7","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-bLTzc/F2d+Jj8+amsOXFR+uGZN95hb1M1VbN5ondaTYKOEZh4cA77L1HRqySUAYyOokwWQWzBevmtPOtf+ISZw==","shasum":"ab08034d7fb2bcdda551e853980aac51d3df223f","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-7.tgz","fileCount":14,"unpackedSize":20487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWDtUCRA9TVsSAnZWagAAwmoP/22nBAYBludQgck2SeVK\n6dQyjHX/hsMTDxY/U3d5ZUToT6fzUl49AU2kAZecv63onh5tb16GiBKM7GGR\nWG2R7abAVdw/pHsH+ES4sp8wl+vkEYkAITyP6sOQJYSfDILkx9fJ+d34YyMS\ntGOGiMvhpQcAp2Uo0w3lc8veIB9kojSf1QYEizFtWnpirVmz4UzA9M5+WDXa\nHvfekVErKuyjlKksCmk51kohXj5wOFzAhhiKEBCv3vzsBKMDiP9H25+nxZ6f\nVxEQR5+grxEyINMRj1eN7QmQ1BJQG66l+GHk58AY9386KH8x72vSBwWBvrJn\nh/DrK2pF247E9cESbCWdLaUmO34kdmUGwuPfEfp60s+L42x3AtBxhe+6uYCd\nx2eszUswLxkHmsuwhoKC9+LpvDjlMC8RgcSi3le+J60QefbONqfptROAOK5u\nr9xve27wmfgYI7HG4gJGsJEpTBbOcrZpvgNl8YNhsy4WVuRdIbmMS2HIjxma\n2tSYliHWTNvC64dmSHL4SfoYAeyKrdlfbiPfWeUh/+NoKRRhP7hTyAqkjzEN\nC1gZbmm6Yepnaop/CZHolhPs3sVJnq9TjoYqZm7tUiF12HVogM/fo6DKIeLs\nsKUgZZT6YO9Dvz0glnhdrQhmy6B5JyV1tHR7LHKTv2GYyhtUVs9/GtMvkkUH\nABo0\r\n=18bn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPmzDl+SuUEBGwJZIj293bOIDPPAtJ7WtWm83Nl85IkAiAfpXdwQJmiQmshkhg0cOg/QOzm2cStKn2/F2nWvkaD4w=="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-7_1532509012589_0.11584534218863407"},"_hasShrinkwrap":false},"0.0.1-8":{"name":"redux-adapter","version":"0.0.1-8","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"0ac4b2c0b7a004909a9da3874ddf3911e5d5f3af","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.1-8","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-R26+21hs2gaJRI/dit1zRpJ5lEDDHc3sfv50oJiNXyRo1Do4RKHZxeIv0jH7j/Ew4VuSYJuwYRL2hrycKH/XBA==","shasum":"f1c983334d1ee8ee86887287b4c1c24c3b2f94a0","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.1-8.tgz","fileCount":14,"unpackedSize":20870,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWElgCRA9TVsSAnZWagAA40IQAJOM8HjExkeaa2o1I+wr\nXni83HftVxnRU8JIqGK2bg4mxHmck/ZU2YJwhnDmSZMbIyZlGvvDkwRwrU/8\nL2Jo3Ob4rH2IIJdGvrzXePBMbx9vzni8lKdoOgThdbseXhrRtPhvaG9k0T/f\nU1zlqHRuXi9XaA7cQz09m79FFx/ixY/EascDeI439El0DOgfPRvIOnXT5FrU\nd5oUae/hTzwvKNF5Pvj/xuP6bqaV6WwqpFwZ3tqGMJ0aB2MFezUo4S4Dz+X5\nxxOnP0/Tt9RogSYQgsXdr1ubD0uy2gTACNER69Jeji2OHKtIieso5fQzD4o4\nfcFQl1x3EqXStMuQNXq90ffOODid0l7nddCh60d/PDQNUOqRIlAdR+8ZBpnT\n0FeFP6KcMUlM9zvwKlHpdUXP0iQLt4i4PYpttfde4z0tteOJgmpDy6g4X9xr\nLFaNybtHo0ovxxvP5cLt1OhOXxGtfYbJTO75at1rWut63cdC1WyuNJXy1gnG\nX25Db5r5dEi6ydvCHYZwGQ8gNpIxuaGLkUgfxshgpOcComL2W9jNIo+E1Gmt\nyC6YSqC0ah/TvbACiFQcF0mBFrpLnbK+iMhPrNXJzFTUdtXmhuChYI3QhcGF\n78YKf9TKJ27ODyuP0gzGVJjs2SI5mEzgEnGxgiU7dheaBpZnXxEt0HHdnb0K\nm6Jq\r\n=zPNe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDmBEuNsOwNDjnmjrvFyFXyoOs9n2Ax3IzqBNK69+vObgIgUTh9m/E1wmqfkICcCSU+/KudoVziYxzDiRt21CCVyZ4="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.1-8_1532512608300_0.10768535562927473"},"_hasShrinkwrap":false},"0.0.2-1":{"name":"redux-adapter","version":"0.0.2-1","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"96ef3a344f612262e9d8cea7cda18083be13249a","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-1","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-CB1fEcTarx5RlwnTR1caSuO9okJoNDY1NzeuDEIhAv4ImF2zSycHUSzi4OfVjsiAG42NJcTq4mcW3HbB8sd1Uw==","shasum":"af4c7d2ef4ddd707a0441ef9385bd60c89ada60c","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-1.tgz","fileCount":14,"unpackedSize":20995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWEn9CRA9TVsSAnZWagAAfLcP/RwFaR7vl6Gz/s+2F1bd\nRwmFJRKo1SMpX+RhvOvPOWCuu8MISnHMOFXAR8MXKWvUfvi5Exiuxu78YQiJ\nsdzMD95L3MldU1qFtvmuRLM50QYW2b1F7pOU9cfHFhMJVREX1kWsIkHoN9QE\nlei0/o7jFymTyaUcNl8nNF91itXON4RnJMsFaajEPnN3zhqDtRgrzK0+in1f\n8qZK0Rnq+UHD/SmuxrNdIwNreM5bfx6o0flqongUD3C1+o1Fvoho86rpZd0H\nBtVv0xcJMd2nSQZP6igbyDqbq2zeHpCJzl2cEEyy9Uh6h0FyaVRvEtUc8quC\nv1zJzqs9bRCNt++wxmA2D1Znnh8+8Gl/1Jf6HtTmf48zq26Wn7lpSEEzHb4u\n3zNcRtogC3ic4/F6XqKPDFUg4WLy2uQyuNP7L1f3aQjfw00kZDWY3YDL8osP\nwbu0VUzZxLGxMSumDkTZ3+bPJGyilX5C6PT/FB7UvHc0Ocv5PLd2x7svMBPB\nM6ta/+LTheg3hl6Hdr7n5DVnnDF3hMDjO3skhbs9EFO14QmR3Z6+V2CRX9Oi\nAq2upbi/N5pkzXaAinZgE8odnodJwH9VlsiSny8WvFp2d3zcDx1Wxej5zRI/\ngz7MGw2ne2ik0mXb+37mlcfMoA/BMFhyvTfqszCOfNNlgqi8iuGmXlBpoCSD\nhqM7\r\n=iPQ6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEqs0RJk+2ws9RTc5oB2+qYq54+SGAp0r3wIwBBii9S+AiAG8t2fMZ3cwCIXwVlaC7J3mMwOm6e0OGHxYjXpZY8JTA=="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-1_1532512765350_0.9753566044454349"},"_hasShrinkwrap":false},"0.0.2-2":{"name":"redux-adapter","version":"0.0.2-2","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"3962a3e64937f64d3ee4c26d1258bfdcfb8543b7","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-2","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-7Ce6sKi1r8mqT/kGOmyYxuWNb2puAmG8Ekfbzya7f5UNNtm8IaIP/8ZJXi11RbmQ4PCqqyfh8HpzPi4KBxa8nA==","shasum":"d85c95d2e4e7473e901ce6352feffed277762b94","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-2.tgz","fileCount":14,"unpackedSize":21126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWEubCRA9TVsSAnZWagAABQYP/0T7xbBvdHnB/WEXh+6N\ncCWQafk6b7a1sDLAdCncuyEGWdPoYTEn6hCWDqxYVLm3ca1rmzXCpnTdQwXA\nCn9GpFoKUwr9BVXFcCmEbyy0WhE6q3jSKyF66Dt7ndkUHpxtHSc5frn3hvMb\nW+F2jPMU+UfLnVR2S7oMVvlNZZtV7IRws931n+Wf/cwzhtCkZQyym6jySTt1\nAse8Dn6Pnr4nQuYvIct9tDuZ7KbEcdyXJycNanh+ULh9O4TxaW38cR7bAPXm\nIeGOtb68KnP+P3djMJEGHxdFoiT3EzfvyeqaLXCwHZGT7R5tUrCOPlPeDNeT\nj+aCOh3d3PUAivd/yXJC1Tl+GiUjnhoweEzfj9rAbzxgFsAfco/h2jcdvBuY\nxp+OMWJZqTLsJBOpLzdyx567d29e8Xd0EoB0K5kMrcdp7InAem+75zgrVG0k\nR6fpju315BjfeKHox/vm8Eb4fxlITeZVkr+2G7n/dUrFNPRUv8AzGQiELflY\nqEb1oPt44Dnb8MPQNjrMQtpxez3Pg2QxUBxg/dTGSIXHMEtrW01WD01YuRwm\n/AtU9cgZXnFUvkngOgUkIfUs89cpYyZdlvvH794Qrui1f6LIe/+mIUAj9k/6\nkuMNzSwUbEqbEDnf+51juisDEPWYc7/jlVsoMikcTU63EFnbEoNJFyhTg7Iq\nCZ1d\r\n=bEkX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFA3Uuq2R6frl4njeX1sYBVyv+nrRJUnTpA10XE7Mu9EAiEAkEyXC/3QFNu9OxOy1azWEe1rII0ivt4MCoqo7MQ2AvM="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-2_1532513179658_0.19036956988502873"},"_hasShrinkwrap":false},"0.0.2-3":{"name":"redux-adapter","version":"0.0.2-3","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"8df624c3d52f2049f5627e0e8b69c0f63a55d098","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-3","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-c0nRJhsSFgCqezXECqZJo7TOeI+YkRPH2xH3r9tQ3mL5mbTPlKzmMs1s5wAa265+uBqPfbWy9Xy6W2WxG6rjgA==","shasum":"c86df9ffa3912971b98ea98ace9510e3916579aa","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-3.tgz","fileCount":14,"unpackedSize":21218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWEyjCRA9TVsSAnZWagAAYjsP/31eGrDKKoBrCkMjsEcb\no9D91hN6wjWHdZDpifB9dBB6tF9ICoYRDL++vhndTVLgFBj8ERUpfYATsv5t\nG9XHEkfE3uTBt6mR0luYA3pGUvhT/vHZB5HlLt5QnvsrNBuv8MceVGJtMIlS\npasSPMdoR4yIf74q/hAOlbMQ/i3JknEewpKcq1bsk8/7TG03l+uX2uEE75lO\nv8TEqk0nwOhv2ZUBWAV/OeZOWLF/sESl66vIbUNMA8Z8ijuETrTu8dNOiU63\n9Mc0/b+BFFphJDSPDzSVeNRfgWc0F3hTlYzg0odAKYWq5UBhXsV5oIyHd47r\ndXT1wg2t9xScTXN5r2u4cudftm4hEIF78Sbo/digQJXUeNl9oMcNr8oBfIwO\nBx32oZnkAc1AgzNlK82CcsLNxPuR5vCDE7XjMUxoZ0oCmayNvYovg0wpixlt\ndnm9lc0GVvrsO8xW6wIKbOZrp8yLrLrghS44Y51BmUnipZZFjtcoRUmN+kRO\nbTO8aM2Mugb3VkTt2rhuhTGnDNhdAHbNAH6bRz344+Ej51miieJJYPL0FhNX\n6kLsjaSTxBHAkbvJxXvLL/46JvxROkGt3JAHZsz22NpRwWt5p9mVL1JBzCtY\nVNY0KoCuJoAetMYiswv/zD5OZxQz+OlQ+RLWqKl8x8LaLQ/KIKNvN0oe2vlp\nXmHt\r\n=zu4g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZr+YTogJ4tqa6iX9mne+S8YFIMs9RwjpxEN7YB2j0MQIhAOeCMm8gX29SbjO36NTLqKonZefwA10LIOkOYWuq584A"}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-3_1532513442988_0.5111030711611242"},"_hasShrinkwrap":false},"0.0.2-4":{"name":"redux-adapter","version":"0.0.2-4","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"17eea3da0fc2d888623c480d8a922839d3a7ed2f","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-4","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-WusKW59U+HIXR0hUthEEcWWFRoEQUs1GzF4hIbLZcc6JzcbtonhCP+xbfdplMrsrxs4WMCkiKdMd7UX7+Shh6w==","shasum":"c791e2d85964db1884fef58e8398c176a8038c43","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-4.tgz","fileCount":14,"unpackedSize":21360,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWFS1CRA9TVsSAnZWagAAj/wP/isLVYCRBecXeD2YXawR\nA8CpZbjIJ6fSVN2XJ5wcO31o0g6Q/vMjcijoEa7VDJ0vyEwUmOhs1JkatTO4\n8wSRAhgIzPVDV3QQ+LEH4UUOA0RGX3enOc5G0BiXNXgQyje3GrBPtFXp1A8w\n7o3VDaPNwl1XufZcRNY7zhY4N7PcmTcXxSlPCyQ4O1DAyIsBilU/Mjgvt270\nTGqMDKg57VuTIUZ1zbOMYoih6tHVyfCbgZN4oMiY3aruL2VRjDupCnoLSE6P\neodQU3bPqIRfKn2blHWH1yWJNAL1rHGf9L0LfkAKcpLa77SYR62MZ6stoZSG\nvBSHltg+s9XdT624b7rLPjoAeQonk6pYdZu6yzdotJ64XEVxkR8U5CqkPGGR\nSbKolVr3Y62jq7prXz631sXw7Sh91PHAC5KAncrQNnRDrMDHJr9j8iaoAbjq\npkzbdmv5WuMzJZboBwBMmN0ueszquwolSZXIQCZshrUafKqG+jbLYHsdtrs4\nR6Cb0vYKCQDPxemY65vhGP6Su2gLYxgLzw931+D07Bseb2vnCF8ZJJxZC1U/\nxilUVV6npNcZY+3KHz5LWAAFCXZUcRibbXQLTtjZPN5fcxR2V2AGwbKAwUKi\nIAulH1U8UyiDV7AV4Uvmk3dWTFfjqsOciEjXMoVeZt7UZhovgkjFbag115Y9\nGn1t\r\n=DZP6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGvxrKwvhmKXNu3IyKPNQWNWnfENOHBRZJLG0vqro9OAiEAl6Q7ZUsT8bLTdxEedm/IXKYWzeO4AN2r6rc3i+QKGm4="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-4_1532515509613_0.3633454133192904"},"_hasShrinkwrap":false},"0.0.2-5":{"name":"redux-adapter","version":"0.0.2-5","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"3dcffdc3e9caaeb2afaf23dabe1a1359b4e2937e","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-5","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-t/FK+tnUNnH4MEcadhXtgGs9oVXVEV6yvyD6LiskwXUWfKPce+AJrKJStIjP97jVR33r0kq7EBKYmVM7fq2naA==","shasum":"8ba6483c8f30b15894976fb115469c3930f76bf8","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-5.tgz","fileCount":14,"unpackedSize":21498,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWFXDCRA9TVsSAnZWagAA8GIQAJvdsaQRStO6fTzGW75r\nZyYxsWbl6i8clmcUqYbbDCQY9ZXE9p+S0vK2dzFk287njyhbCxeIKDkMzP5V\nqlpqq/Vu+XHaEMl37QPj8nG45DhBJG2RGzwM2nyCW2yzwfBwp3IBf3WE79OV\nHKWqGS9CNfX9Jz1Tpn+a8kFcHX2YzIB1C+PjDxHRhv18JG6s1vQU5PWSH7Hl\nTLiTjVGKxWudF2kIMHDZ+SIim4Z/DXJUWcLHz91q7fJyNFs0dqocdiltbJ1X\nvxn2nhk3oHSByfxnDQHg49p/23meubs9RwtIwAB4/94mkPQTaHv02jLLlJ8e\nlrdv9Wgc+XSKQB1S4OfsuTOZ5i2dPuYcU6HV9XYkqZjXfCyrinK4NjCzn+mt\nK/lInrCf8ET86GDHeJnIiOIO6GQWB48d6DqXb45eP1enWUiMo1VMSu6iMhhb\nItSDRPsb/MHvI89k5DTQC/UYnjZmA/87hQrN8EIFyISxhWf+GgWUHmq9P4q8\nlu6dg3IJtJcB5SC0G/Fs5k3Yid9GXoxIuC3k3MsoLmwCsPLxJ88vJ2m+bg4B\nJPXA0sfrkI1nQxU6JLXefNinlSJHRpXI9pW5HHGV+wGW42Qr8ZhS7EhBTxem\ngDKHhEfeTocc5heju0LELYP/2aetWuXo0EbgaepJzdilMLCR8dq/fMQnmBfW\nhHhS\r\n=9RCP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzhWsup1RUbITDve0RRDg1HI+wjQ5WZ8OiuTO+dEuiPAiEA31hfhz3R2nH2iszCA7rF+2ubadfsE3WQJWxrIBUGDq8="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-5_1532515779529_0.26695145438631873"},"_hasShrinkwrap":false},"0.0.2-6":{"name":"redux-adapter","version":"0.0.2-6","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"126174f67f8eb429898ba720eab71984cd560e5a","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-6","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-n3MreGvlSE5cyFz225p+xkzpY3TOrzUIx8GwExAd7mTRis4LAV/SjZ2uBFjCXcXXJ0ZyqAqPZ65L0MjvDBWtWA==","shasum":"0e5fd8d91b2e0ca71ff6449099f2ae9c24b26f17","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-6.tgz","fileCount":14,"unpackedSize":21622,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWF0MCRA9TVsSAnZWagAAH5kP/3FcR8sYKdDZpOscNvl9\nSfbx5pckVebsmRljjFFpJ32ut33c/9rlU28ru3TI3vadug41Kfq8IlK6MbYj\nwjYbd/QP2nMA3PhMohsdfGWyXjTbphypILL9UWA6gfutwLXEX8is8nwWJRU4\nE8Y4Vc5fgt8TVfYRmSeCZXeffJwKwf+ymTIAqU+8tS8HzjIZZtdoBylDMWwU\nyssi7Yj/HS9cF18p2HLB+Zk0Yhc3S7z+3gUSJEXVb9/jAgnuOnh3w3kXd/At\niPN4RJ9iEbpgSXnEvhCQYEpCb9pAA4fsEbN0BV0X8XBgT3MtoUpN+jU4VAet\nHWyAu2AmtLWGtHnx/i9F3RVz5g0szKrcilZSgwhpjxbSNiUDhvLNW7Hyraft\nBmritJm36TuA4XOvJVr2sa0QUUkbl3cYrC1cQjd2UF4Qm9CfgXlHZ8dUHDoo\nmMOdFKqDzzJhDdJLm1+tyOU1SZVGOaU2JmFU1nZxw3jit9AAPFif079vDytS\nUNpJtDC2ipRxCzfEJduhi9wOBuosgurFVXqFgQnCe97tEiFEVGkGrfpzxXqR\n/enre8QyAlMCwMpjxjVr5/EUZb+lrp5B3Fkj4hPZ9yy7kXVfK0gxkYHZ0dV7\nB5rKllHh4PgF+b7CsrBAJV9AV9jO97wG18zKO8I1Yi7lGz9kBAuTiM9ReeNF\nak4b\r\n=8qKk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcYc+056WTVe1Ab2r+amR3fXKUdcQvApB2X00gNtGMAwIgPzfv0R0YU0MTteYuuCFeruA0P/I/uu0J5qVJaafGhjw="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-6_1532517644452_0.7818224817491042"},"_hasShrinkwrap":false},"0.0.2-7":{"name":"redux-adapter","version":"0.0.2-7","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"1ffcdb456309ad95476bc8740e6428d2dbe2b4b1","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-7","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-Sz/LYKV8zh05iVe3/WBVnHwXufveAPc27E3JcdoPoHf7DpyVn6a8ahQkkIePSzGJyVh61PrgfGyn1wFDaMG2UQ==","shasum":"5c2d6d1de036931dde19b193b1286970f15bc5cb","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-7.tgz","fileCount":14,"unpackedSize":21722,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWGBYCRA9TVsSAnZWagAAIt0P/i+j3Vp3XLJxdIpshOAP\nfrzKTLCRi9Xe7y9DrArbgTMGBX/voCb3iPxvHSta20bAFf3yfoLFvHBc1QBk\n3sl5RzHUQcEIBxF0RW5ihBNe40clOD0p460nJuPbF5wTntJ0+HW59w8PyRch\nL6UDEM9JnD6uqDZPHgOPhRtNAwdyyFTBPMZIClcaJEgppHgYR7qjA1iSmIYG\nmiE+kAOrG8yxytvPduDqJEHMNppK8/Pw9kZGmaPDIxg9ILKXheqr3pcibot/\nN1ineupBdX1kMkoL/pYHsU2rfA0VlFWM7wx7gR7IQST690ReCN8/1U1Few7U\nibWmakJHA79j2GPQ9dhscHEpOsLsLaydeaa/olAJgx0ZVmmT+9jV5mLfTGl8\nCWqOb2UWrTXUr81nY2ZCNy87OIfRBgQN1MAr+wBc7EWvzXSkgIEWYSEbpw1+\nf0yUt+0SXBjAKAhd974Lhp3bSp23k5JELnrJvYPQI08giPVpWFG1Y4Fk7B4a\na8i7ZO9GLhf6z5+X7/o+jC2xPqjZHEFqOOc+glw5cYe+0cYzzlCt0gKcCX9O\n//s8a8qdFhhwu+qOa2FZcDkn21Kar3UNdGCiobswqqJ7SuAmirkalUHcYEt1\nJBI4GPo9nZZ5g3OL0lRoIIJvaaq0Zt5d/zq2b30RpCZMFpvYIVP8Z96kvA20\ndJ1S\r\n=esuo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo/jGP2Uy62oxV54kFD12dUfWOMIVMT8dum5JnNRWu1AIgUoDQNwzRUPN7s7HZKoKD9TDFDkl9p+hjRLriyTHxZLk="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-7_1532518488160_0.5339461754281634"},"_hasShrinkwrap":false},"0.0.2-8":{"name":"redux-adapter","version":"0.0.2-8","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"92fc4f7f8a34065eea496f90f93ae17b6e20367e","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-8","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-cAW8LKAreJfUD5QgMIDw4MZu/ZAwQaXiEXzAlHAB4WAcdO4tmzZ7/myLjlJooU7Gup0bqI/YIELP1TifayhgFA==","shasum":"ba0b93fdbf9f98efd7b56ef402f91318f3058d3d","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-8.tgz","fileCount":14,"unpackedSize":21863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWGwsCRA9TVsSAnZWagAASFoP/ihdy1t2vQ6bnfTShzQI\n8u+zfgjDSQwCiOl/U/0fqWj+/d0n0I8Y4uX3/b0V1qcXuoyLJAGfW8CBNY8I\nccgq/8x6I8ERs7jR91CePVrxHfO806wdghElKKJSfOQf/uEN6hUXfPWZ4Lpk\np+cKZj8W13OaNXM/1eHdMloNz943Zn3v3+RO7yTVlO49Jfz/uCg14mgOFxlr\npNjsbNzZdIbvyOLMi7A5m9RMhmyJSmZ7sZxN36kSUWJpktX6ANcfctBsvaZm\nomwkN4qfMImkAMtD+BRjIFN75pQGvnJUau3UVzZ+KeqBKvSeY5so4+toIrWA\nH52UYua0FDElcs8Ag4fbjiZdKVzsopIVgd7X9SxWPDGiFK5lwKoeZ6+MiTUk\nzY1dgm3+nkg5wqLonhOxAta8+Gv/qESQ5j+3ZAf/j+NYvEirLoPBGKpCUDKm\nFBQooCTkEM8nYA/3gkR1HzJMFx6XOKzXt4WQixpexvgEm6BpGoRWcrwY8b8R\nxvQlCnBQfavtwcFXm/n/AyJuuLTz9Z6D9b/k/U+VDUM7HktE2FQUHtvksjdF\nh9nsHPmzUWjCIUAOT0BtnYQ/arl1OR77Vzc5tHoFkMwQhNhEsnGJqXWOv20L\n8EgM8ogXecxjHpyGghQVUCqDL0XQXnYXzCpHoqZaJuGMMKUFwzO2YErG19Eb\nzBQQ\r\n=ZKf6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeRZT/Kj9oVGzcV2oYVnUY3wJJo3Z5lyYJ17pw/wm+NAIgV8wiwscpDI/mtRPgzt0NJWgs328NHk1maKoH6+XAj9s="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-8_1532521516257_0.9419147713803002"},"_hasShrinkwrap":false},"0.0.2-9":{"name":"redux-adapter","version":"0.0.2-9","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"d408a2377197c2333442e384cbfdce5100bddb35","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-9","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-sqOdG/CZwE3QcX4G5LcCVw2v8I3k++mhlIFxq+yyKQYFj+zZ6cu4Nh1sMLlKiQkWsUhD79NbpPAeowk7xb5nhA==","shasum":"a0789d53b52e87b9646275a8690e6d48f7cf00b1","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-9.tgz","fileCount":14,"unpackedSize":21976,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWG03CRA9TVsSAnZWagAA4PoP+QC/i20VRL6SEYj4DBq0\nN5YbTZC4X0XqgLex8s7adFQyZjZTsggKtcb7H3WVSEsha8QorGJ7JDPpK6qb\nNwQvgIA32guRZGMDZGmuTAXFV9T1Qcs0vWoGGJS4Xp4zQU9UO/UTANAjmRlX\njo+TLBqoe5dsyAOv44Qt6sNTxkc7LqrgrbqD1z/7anLUwVYbaICUPZXj9gXq\n9AZ5zwZz+RE3gMmqNfjv7VkynFVN3n7LqrYzNW9ew0k0t2HHRp3K2sUpzlNB\nH7kFWwqXEIn2Ap6gvMhx8+ZkGYq01Pnthw1RebpJ2W+GY4paBtAVDJeI+d47\ncDdOgeQ5NK04c+MV+Uktf39KqFTuNDGz0UQ22QpxCNxjOAU81FnBAuZBLde8\n9KjdGdwq60j+FTR68VyyxWVPS+6ub8omTEggdyvbECdcMoloayd41oIaHIHP\nBZf3/KnfzXMOWBXglP0wgkxk6WhBhWK/YpINoiWCSxNdSQDW1hDGG+XtdsHI\nV1f3p/RmkRo5H3OOds69HTENWy24JGdWlkmjJsPWpEi1ZFZxTTC2qKaHj+7k\nJQZnf2Pq8OChjlNjBthQfEG6cn7BHXvpwpwJZwc5JHeZSHf2RbiYjRY62Uvd\nmBkgUFDkZSf5FJWLASTYy6weJ5ng765tzrn5WdiR6uIpKDaTB9T5aYFhDdpq\nhYPA\r\n=f3yd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMalwrLUvM9yQaRBkyqfz1WdKmJESUb9vE3dsgGK/2HQIhAPqY2ag35EcGlIkcba8V0md/KwsSke+a+Swq8gi8qKmc"}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-9_1532521783115_0.45041330915314925"},"_hasShrinkwrap":false},"0.0.2-10":{"name":"redux-adapter","version":"0.0.2-10","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"07ff2cde6f9edd5f10fb1578281765df770d704b","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-10","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-NBUcf4SxG8iUYUX4tweBUPdRpzdE+/iGN0njFzm/TfHX9XXTONZ7H05QpA8wn0hRUcmfvS4MBTK0GjC99d9i/g==","shasum":"bd7c58c71803880387210ac2c475a4bcc2e03c50","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-10.tgz","fileCount":14,"unpackedSize":22160,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWG4VCRA9TVsSAnZWagAAK34P/Rl4dn8Dwq7lMCiMvO2f\nl9ByZ76Z1r07ga6MYRMzcPdy8wYvPKkqlX+YHuK8TLq4NhAU+KblTVt9uBa5\nLTXQNPQVjnZMG0H1V/5SGQkmCLIK8NmVvgJRDfyofLWymnVXRRBZsqvEeBtt\nWzKHTmNlDlo/bVx+7CeTCSGDbk4A+2+G7QyHZC7/wHgVMdHWfcJHcOc7HPe6\nIiE7/ADdXL4612Bdn/WphZ757jxCZ9eC2jCsVkXSnsmn9Su/XtKTw4a6klqr\nwXsR8Zv+V/9gsEIFjrFE4yU/I5dCHQqt5XIX3zVB1pyuKTyW/rbkrhG2pdud\n00kSDHj28ZndR5teSWy22fpXNMxqpeBqEUCaIshQJYxD35YN3/jfq1u40Uti\nvAw8Fm5YxkMlVFnXLDN1iKtzfSiXWB1+kj2deZGh+tBoI9tK/WkbVmyoCmqD\n7kkt30CMoB2xnzFC3V0BFAVvrSu4JDGubH7DvOuXPOz81kSDSb9qoQ8SA7s7\nNGueT22Sxaj8Bxa7LUK5OMb8/7tRz8yhPcQqAwPIjx/gBrfyBfuhyCZlw4cL\np9Se0olN30VGnkBUxhKcVH3pKFKSf4c7BamqZrdIsoNbiDxEIWw+HVmWhPhW\nPWoT2nvb+xg75URqYJtptNx+FMmN+/gWi5iGFb0YSx2fghcI+hu3tZizIC7N\nAfA3\r\n=Ylvy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkcp7VKBv5KXKMGSUbhgGSjZqvj/wY1VaXWUlIwcY1rAiB6R3ZoCItrqIKutTyL9GSswu/jQ6ZP0y06MzPHZUj5YQ=="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-10_1532522005456_0.4300334805019348"},"_hasShrinkwrap":false},"0.0.2-11":{"name":"redux-adapter","version":"0.0.2-11","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"ff9ae014b95c7cb0e04850278164f0032ef3033d","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-11","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-BhP3UV+22AHow6cuc0umpViuVz/sKsnkY7b89ubOdrem+u4BYemiphWMbCVf8iBOBY47+gLT82lMgigHSavK+g==","shasum":"89b3aebb9aab498fbc6e3a5a484a6108a151f356","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-11.tgz","fileCount":14,"unpackedSize":22278,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWG/mCRA9TVsSAnZWagAAC8YP/1VKHrnP6kEG7/iJpXIT\nk7CY8kOp0jaxib7nd6wQWORi+7xF2z/qW+BNmgYwJGcoh2/tlDXXVAV2EOwS\nSjYOqUT8bswrMidAFEgYHkh5yMHx1G43Ta2g1nZtXYqnIfgPoYqp1NcXk7VC\njjy4I6CwpwXi1QEUAV17tlr+VZ2EIFgUI1oxNcCiUdrvbqWLNjWKc5acy6Zk\nf0p1MSKKvTEUksAFaUQWUYDH5CwRfNRZS3AF26v509EfneyRJNKDRV32ScC1\n8JXx3+ugeo0QA0ZGyvgRzYDqNW+3qojcZvf5UwBGKnQufTTFbmAzX1jAYeKY\nhWHth4ywr4JHcw7iNaph4xV+TMbpq20buz+CbDNFJhEXv6WkcsXOxHlGS5zA\nwlHFuN8OAV/giaab1oQ3e2+bTHJ2QM1T3m1Ps+qr8DxWlSe9Nau/h54nlWo+\nID8WyCVKxO/nJ+xKlPlusZH/SPBJw7gOhzVGrZpj1ddhf42WOa1QBrpPpTCE\n4vmDhj722E5JcCbHDpvoHQkaJxsKUGLewPRwNxmT+NSLrbvMaMolA+qyqq1f\nKxlSGo2yoAVm6BeYnKTK5A1dwkiWKZOOzxB4eLMB3dvdtN+ethaCPMwavoZ7\nGrIR+h5zguctfeFTZ+e12Kudc2cGW/l3Ju30K5LwnwHBrkJnecrHuENnp3Go\nJQMr\r\n=dq4w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB8xw08OCyoV/J4Nz8foIo6cMo4RqduY4b+LmBWBdvM6AiEA5oZNX3i7b1eANCjkS0XObnYPRfJGc0it2qu+L1IeQ/Y="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-11_1532522470468_0.5156008217622454"},"_hasShrinkwrap":false},"0.0.2-12":{"name":"redux-adapter","version":"0.0.2-12","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(\n    combineReducers({ ...initialReducers }),\n    initialState\n);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.state.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `redux-adapter-id` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `redux-adapter-id` -> `id`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-1\" />\n<SomeComponentUsingReduxAdapter redux-adapter-id=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"8e0e22502ff26de2d53b0189105a2d8fbbe59160","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.2-12","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-HcEz6hBSXI/SFVzANw63ehLnxpRCNjyAhJeWIexaIpw3tZwn47tihm/uoUZVNXF1Yb1PTvqX/lAlPXyNliV4bg==","shasum":"3d1c8f750ce3514baf67dbc72e4507c4c32e7699","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.2-12.tgz","fileCount":14,"unpackedSize":22202,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWHCnCRA9TVsSAnZWagAAuMQP/RP1EUMkQ4zt8cQtzpnC\nR5Wt84T5ZcFveE/Q0yjA/aeOpGX/fvWqzSZUsSoT6S9y4YMsYtHIWInJ54e8\n/dRIUkbtDYwcMCqtR1ZBVo0KKVZYl292EyFOfgDb6lOTKHNzTo/Onu+6jtD6\nUbm1Bn0EKPuWds3akvUqaf5JAUd8ba0TdDyeeN3n8egt0djQ079NvG5wixWC\n7D+5wN4sFoXMjyZS68LVHJ4iVqo4Le0azRvTsA2+tjAwRh/bSSsKiYjZgTc1\nPLlbfEV/RqEgOXYVtYoGEWbGGMfrOZc7VqzvxajOON+sLdG4jJtrFQ/5GO+j\negOmf6vnwEFldRAi8C62g5orX6MLo0hd67llVieDPcQ7ZxM/CGEVAuhnClF/\nHOyKjd6Kyro4wgtUfTPHNOTN6TiDDT4wfhPBF/l6FYvmcsHbIzn32HW1S/Tg\nq2oAk9hIDbrVl5QHwwna1BLe/paFkqFpmwWR2PcDi6AkwX3hQxK1GQDrtkGp\nnZAgoh8Fv54jkOHfnUMb3//2GEEgRa0Cm4ijHLMDSMVF+0GgeO0yKCHTyQPI\nuybzXHD596dJUs903dNkYL8Kp8oh2EqsZTwE4u7fGdXhPI4qYeY7HfLqakC4\nPIs0KNyVuFIntV462HLwrxn0OaguLSPCTP/VGzmfoEdNrUg3Ugr/g52FOzfW\nLNrp\r\n=68k5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFmGJpUjqnJXX2/PV+77dEonsC4hLS7bu3bSXZn8EQpAIgHNvDYPEWiFFWaq55T4MBNkGU3ucY3SmWsWmwhEDdQ20="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.2-12_1532522663325_0.22122625877763924"},"_hasShrinkwrap":false},"0.0.3":{"name":"redux-adapter","version":"0.0.3","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"gitHead":"9cd793443690b6755bea3774eb29ce380d602405","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.3","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-x5vpxV9D54muPzX8S5myhnKdFHN5Eoc6e1CUlYBkHAPGjxRp8N+CY83DQMaXkXlYjIRWx0t1pz8OsGPL8PRwgQ==","shasum":"a8c97ff468098f32d23e6e8eba1a94fd661f1746","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.3.tgz","fileCount":14,"unpackedSize":22569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWHFxCRA9TVsSAnZWagAAavcP/RANkEdUWqia5/ZBsAaU\nN6HoN5MOtxQBWdNz3IaM5NKXIfHB83yIsijfNqoswh6VMDsCT2TTgLu3ADWS\nJ/sBzSvHQP2N7mbrNNAfALNqDgKlmgmbw4AsTTG9IeZk47Er6Fo3Z7f2oghg\nMrBG9nOhWtvollw4GGtGiNs/qcnEH4boKgEKnyelkCk4sbPk4FLynrmDAkmN\nlE2sL0dtAPTcSaUjnBPK4WXuoBprU4nwUa+Ya3KTvQgo0MLYCF9RSJSXrJY3\nwIXIbDuSe1dBhy50crvjSH/PxZ1cfO6IWz5c3g3Vw0YkGnPAL2Q3wpvm+75P\ngHYx4nHElwhBmT9vSVKRgub/CRkCwWseh3fhbs3SrIM+X8ivnxO0b+ugbfZg\nS6LEFfrkldyahf/r5nKpRKpqi8hhMTPctFgbELc74i9uPcf6TRId35eWE3o0\nsOh6AZUndif3/CsWpwrL1u2ArVMtty+ebvtpF8WF+5M0D0ACpIvozDXnYK7n\nNYZedlXXR+fA1HYCgjtpQPwVJ8sVrdSUPyrJnpj5k9MzXhWJSodwcFpG0mZq\nuzxT7m0lGhL8Oxb0HHhLyUfCF/eidsXbmRB48tMLMtxNMlBCBKnV1JWIE3lJ\nWBHW78m4aBiFUbONOGo65DVvuwNQQREPaAwwK18oPhhpuWHHNi6ApG/I41PM\n+Mdu\r\n=S6Ry\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAULpj+v3wocjYtZIN5gCkSopvUmCiWxh4MGekbsIC2wIgVQVt5RlbrYxFXy6utwlPWyj0cUhpGbYDV9sgoUbEwgo="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.3_1532522865495_0.25275583551022396"},"_hasShrinkwrap":false},"0.0.4-1":{"name":"redux-adapter","version":"0.0.4-1","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(state => state, initialState);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.redux.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `reduxAdapterId` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `reduxAdapterId`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter reduxAdapterId=\"component-1\" />\n<SomeComponentUsingReduxAdapter reduxAdapterId=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"5782c7afa646db3088160ce156bb0c49ccff7fe1","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.4-1","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-KjH0F8t5njiShtuTwoW03JkrqJxmE9M/VI0deKmkP2ebbxmQJaOtjyTiyt3j2xw7axrcAoY1+bqVyI9rVhmX0A==","shasum":"c7aa81c8416a2be2134426e84969a1b9e98166a2","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.4-1.tgz","fileCount":14,"unpackedSize":22766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWHJUCRA9TVsSAnZWagAAAn8P/0e1aIRaSoezKF1PZzc/\njxrLbeqvvc8N97npkK8N/ETfisOXDeT6gP9iwb5K4SA3U0GjOUNGJclnqvOe\nNNLpmHVsUnJDkdrurT1VqAfINcGbclkyXlclV2XADaBJFn3i8J2oNNno7gVX\noeFyVniRdcfYnS+AJI9HHJ8Q3VCPUUOh3Tgni2L5w3dvlHVZKmdOeke4efgF\nv5WvGkfhG6ZAsQ44uMLx8Dkvu3CzC8tcs5XX9YszGpWbx8wP9Amq1UIftWEh\nx7u/BbFIlWBUmFZIEw17mhzP9ngTrEdXpVo35rXMC0aOlkjISRMOt3AM7omq\ndvTuGaYdmwbGBmjY4K04cOBYFRf2KUmif8R8kpgDxIFgoOaKN4OInl5cSkpB\nNkHqyOxW1GIl4eaqZoWFveqoOygsawgdyINXxyO51ZP/Obl4P+dnNBj7aDGg\nQ9xRfBs1zyGj0pAI+QawLPu83REy1z6I5SFAXGEtkaGcVsCBBtIass6puccz\nv2Y3r0RSzvMJnGsXcBpzFfbnQy9oiENCmQApQTEJE8/ZluK39S9PeCCLwVe0\nepwR0VnOmiT//ekDQEbhtTwmdFP8c9e/90dJQhIEmorbpCge2zc/h+MkYIHM\nkAHrj5jB4rOygHaGUK+3UZ1Y1bou9Oh9DBBb/x2NIjwrtgf4bNmcgiiE8eVH\nW4Ao\r\n=9IZa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8yiTiBPBUXeQRTxKtPPR6Dl8U49/0rS/y+gtVQR5iBAiEA7gW3xAB06aH/6CijAIlLdhb+oe6/SXiwzyJU3LwHtz8="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.4-1_1532523092468_0.597885471337221"},"_hasShrinkwrap":false},"0.0.4":{"name":"redux-adapter","version":"0.0.4","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"gitHead":"713dcae22f41002d6096d7ac9ba53efb2e1c6b0f","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.4","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-X+wVJlp7OKJCsnxj3z3zBF2C1QT1kV5P6xrXHa1VL+xIcLosMv70oCgXpkP/LxbmF5flpIUosRwChzndkin/lA==","shasum":"ed7365f43ff5ff1771e85c8660bdba4f36dd2d55","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.4.tgz","fileCount":14,"unpackedSize":22883,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWHJhCRA9TVsSAnZWagAA2GwQAIKzAsjsTrhD/KB6M1hH\nYbEz4BHXlu3/3ofmneZn81R78PfY4H/idY/se/wJkRC9yacXngreAWRRy7kK\nbqpbv/zQj/77AAyaH+ACFVIQFcPhzv0b9gbRBp91cDCeOYhIUHAnMnm/oMXx\nLC68Mgf/A18/O3UyUs/+aVtr2qIMlbnIeVPCV2RnynE3U4ICZLrKsmeSCJT2\ncKg62SZzGGq6tGqkCi3+AG6CnhL2gr9U0dHykFm3F/INPLeHeXdCb2XpB/Qw\nLj1FvGHhsbBXNc+tSC5Xw7a8Jdy/vL1hak8iWa7P0U8qHhxPn+dTk9olktms\nYVfrSuEuXxi6uLmmMlxict5L40EezH54kjCBACkO5IFue23do8Io0u8U4rI/\nEuZFYkkIklCY/ZmlDN9uVM0y74muI21R0eY/SUmXDDAuvhnbqCdpvahlHlqM\nYNreW3psacQC1REjnDI+4rIhzif2nZzFuiXJjnNtlau56B/D3YJK27fuB/ks\nAahU+99HMuLXYHtnU2Q9ZQhfaseFNoxmWQ30pIMG3ibbEa7C1q9HICf/Vn5H\nG9UGjoWAwQBN44OqU+MjphxqC7leRHLydu8RKzODB9qqS0IeH/fpRHU5VccH\nCzmqIkcLAqfvwPeilnRbshyHT6KGCanyT84scpnaytSDcLYxrDpmupkIYdvD\n0aW7\r\n=KOVa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBayVgwLDpUhOTUrrvbNjS4kLj5TKoY5cgVh88zxc/KEAiEA/k4BQY8PYqhG28fRBQSXvt9TCdWRCkbaJKWq6MA+V4s="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.4_1532523105901_0.6817714971570514"},"_hasShrinkwrap":false},"0.0.5-0":{"name":"redux-adapter","version":"0.0.5-0","description":"Less and better code to write redux.","repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"main":"dist/index.js","scripts":{"release":"npm run transpile && standard-version && git push --follow-tags origin master && npm publish","prerelease":"npm run transpile && standard-version --prerelease && npm publish --tag prerelease","transpile":"babel src -d dist --copy-files"},"keywords":["redux","utils"],"author":{"name":"qinyuanbin"},"license":"MIT","dependencies":{"prop-types":"^15.6.2","react":"^16.4.1","redux":"^4.0.0"},"devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint-config-react-app":"^2.1.0","eslint-plugin-import":"^2.13.0","eslint-plugin-jsx-a11y":"^5.1.1","webpack":"^4.16.2","webpack-cli":"^3.1.0","babel-eslint":"^7.2.3","eslint":"^4.1.1","eslint-plugin-flowtype":"^2.50.0","eslint-plugin-react":"^7.10.0"},"readme":"# REDUX-ADAPTER\n1. spliting and writing actions and reducers into pieces base on components.\n2. automatically add and remove reducers of redux store with component lifecycle.\n3. no concern of `unique action type`.\n\n### usage\nActions and reducers will organize in this way.\n```javascript\n// state transitions\nexport default {\n    // initial state\n    initialState: {\n        tasks: []\n    },\n    // transition events\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, done: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\n\n### install and coding\ninstall:\n```bash\nnpm i --save redux-adapter\n```\n\nfirst step, init adapter:\n```javascript\nimport { createStore, combineReducers } from 'redux';\nimport ReduxAdapter from 'redux-adapter';\n\nconst initialState = {};\nconst initialReducers = {};\nconst store = createStore(state => state, initialState);\n\nReduxAdapter.init(store, initialReducers);\n\nexport { store };\n```\n\ntransitions(`actions` and `reducers`), filename `./todoList.redux.js`:\n```javascript\nexport default {\n    name: 'todo-list',\n    initialState: {\n        tasks: []\n    },\n    events: {\n        addTodo: {\n            action(title) {\n                const task = { title, completed: false };\n                return task;\n            },\n            reducer(state, task) {\n                state.tasks.push(task);\n                return state;\n            }\n        }\n    }\n};\n```\nwrapped component `./TodoListComponent.jsx`:\n```javascript\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { getState, react as reduxApdapter  } from 'redux-adapter';\nimport stateTransitions from './todoList.redux';\nimport { store } from './store';\n\nconst mapStateToProp = (state, ownProps) => {\n    var currentState = getState(state, ownProps);\n    return { tasks: currentState.tasks };\n};\n\n@connect(mapStateToProp)\n@reduxApdapter(reduxTransitions)\nexport class TodoListComponent extends Component {\n    ...\n\n    addTodo(todo) {\n        const { dispatch, actions } = this.props;\n        dispatch(actions.addTodo(todo));\n    }\n\n    ...\n}\n```\n\n### Tips\n\n- when coding the the transition, you will never care about the `action.type`, just name your transition and put the `action` and `reducer` in the `events` namespace. reducer will recive what the `action` return in secode argument, first arguement is `state`, just keep same to the redux official.\n\n\n- it works when `componentDidMount` and destroy when `componentWillUnmount`.\n\n- you can access the state from global state in `mapStateToProp` funciton using 'getState' exported from `redux-adapter`.\n\n\n- in the wrapped component, `reduxAdapterId` and `actions` will add to `this.props` automatically. `actions` is all the actionCreators you custom in `xxx.redux.js`, you can dispatch it easy, e.g.\n```javascript\nthis.props.dispatch(this.props.actions.addTodo('eating'));\n```\n\n\n- recomment giving a unique `reduxAdapterId` for each component, if you want to save and restore state. Because multiple component at the same time. `ReduxApdater` will find the id in props order in: `reduxAdapterId`, if you don't assign this, `redux-adapter` will useing a global auto increasement number for this.\n```javascript\n<SomeComponentUsingReduxAdapter reduxAdapterId=\"component-1\" />\n<SomeComponentUsingReduxAdapter reduxAdapterId=\"component-2\" />\n```\n\n---------------------\nThe MIT License (MIT).\n\nWritten by [qinyuanbin](https://github.com/qinyuanbin).\n","readmeFilename":"README.md","gitHead":"8a95ff7f471546523ff167e072434285fb1a5cd6","bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"homepage":"https://github.com/qinyuanbin/redux-adapter#readme","_id":"redux-adapter@0.0.5-0","_npmVersion":"6.2.0","_nodeVersion":"8.3.0","_npmUser":{"name":"footreel","email":"qinyb@foxmail.com"},"dist":{"integrity":"sha512-ifkishMiZnv/IuEhdbeMfgMMH5ZlSVDuZvYSqGus9pjbq2AfTCYGx79DCQiDvVf+29egacdrpA9qPv0kLL31FA==","shasum":"9ead80f7a1ea37712a7a7a7c4f6f9065073a6567","tarball":"https://registry.npmjs.org/redux-adapter/-/redux-adapter-0.0.5-0.tgz","fileCount":14,"unpackedSize":23002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbWH2YCRA9TVsSAnZWagAAbuQP+gJtr6giiDSsWdLEQV16\n+wPhxbnfpXCxt7DkrbuJMFmB4XB1bMROigvcTZqWXkfMoK3VXP/Z7riXD+80\nvG8OBwuW+knp10zfXHTvsqs232SNFKKP+Bz1v6Au9qAUJ246WHvzz9Dvisph\nMU2uDyrbKSYXhA0VBJKMuY/LwtoInHAmC9BImc6yS1C5mFXxiD9N5kM6Ytus\nWu2OU/gA23V9jZ2fG72kBx+plQB9bGnOBQgW3dMEEddN0dnOyq/ZGCIa9t83\neDizIYmCwNBQ9N7HFIKmPs/tgSJHgsY7TMm3S93JOjehIE0SQiUaH52MXpFG\nr2/OkEYtipCOiXAYZL9TWj0EWQVmBMLEE+XpyqGmu4/DqESR0b3F/h3yRTJF\n+ovG536+5HqqMm+3XVMEL/Om8EtBHDoZCwfNEXtpRqQ+wp8z5f3c8rRQJQIh\nG4bB/eT8H7M9dzca7sDVDPLGqDjJMDJjJLVB5DZ3oNit+3gD2vnNAyK7AlUB\nlA45vM31sYCTt9f8EdKGlTdBq6nW9brTfnTNm9htSRCxD7xOigHAIlGQuPTK\nJ5OECkhq6thUHJd0IWr47hWbadfdeii4nvHShMw0EWi4UFQLZSjPI+N1klHp\nMgvSWBYJV1D/eXYx22oyxSNbkEeF8lTVEiy0nNE6GVfLn1gSGrqL+2IFOrPe\n1Jrq\r\n=CIkJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBj3k73RuhqB3KcigRjupsyVtSqjIbzRhZwqmKxdKmrEAiEAyZDlTAfoaofoyOSEjLUjNTKDuikPNU8+ffwvAR7GTfI="}]},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-adapter_0.0.5-0_1532525976771_0.45840208059262966"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-25T04:58:25.695Z","1.1.1":"2018-07-25T04:58:25.783Z","modified":"2022-05-15T14:47:11.631Z","0.0.1-0":"2018-07-25T05:04:20.137Z","0.0.1-1":"2018-07-25T05:12:41.188Z","0.0.1-2":"2018-07-25T05:33:35.780Z","0.0.1-3":"2018-07-25T06:18:07.082Z","0.0.1-4":"2018-07-25T06:30:59.430Z","0.0.1-5":"2018-07-25T08:26:41.807Z","0.0.1-6":"2018-07-25T08:56:07.332Z","0.0.1-7":"2018-07-25T08:56:52.642Z","0.0.1-8":"2018-07-25T09:56:48.386Z","0.0.2-1":"2018-07-25T09:59:25.514Z","0.0.2-2":"2018-07-25T10:06:19.756Z","0.0.2-3":"2018-07-25T10:10:43.098Z","0.0.2-4":"2018-07-25T10:45:09.683Z","0.0.2-5":"2018-07-25T10:49:39.606Z","0.0.2-6":"2018-07-25T11:20:44.560Z","0.0.2-7":"2018-07-25T11:34:48.241Z","0.0.2-8":"2018-07-25T12:25:16.537Z","0.0.2-9":"2018-07-25T12:29:43.185Z","0.0.2-10":"2018-07-25T12:33:25.573Z","0.0.2-11":"2018-07-25T12:41:10.593Z","0.0.2-12":"2018-07-25T12:44:23.400Z","0.0.3":"2018-07-25T12:47:45.583Z","0.0.4-1":"2018-07-25T12:51:32.622Z","0.0.4":"2018-07-25T12:51:45.958Z","0.0.5-0":"2018-07-25T13:39:36.820Z"},"maintainers":[{"name":"footreel","email":"qinyb@foxmail.com"}],"description":"Less and better code to write redux.","homepage":"https://github.com/qinyuanbin/redux-adapter#readme","keywords":["redux","utils"],"repository":{"url":"git+https://github.com/qinyuanbin/redux-adapter.git","type":"github"},"author":{"name":"qinyuanbin"},"bugs":{"url":"https://github.com/qinyuanbin/redux-adapter/issues"},"license":"MIT","readme":"","readmeFilename":""}