{"_id":"@aikoven/recombine","_rev":"4-4f84b09bf84f2c2715c31e6d5b283694","name":"@aikoven/recombine","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@aikoven/recombine","version":"0.1.0","description":"Utilities for combining Redux reducers","main":"lib/index.js","module":"es/index.js","typings":"lib/index.d.ts","files":["src","es","lib"],"scripts":{"clean":"rimraf lib es","lint":"tslint -c tslint.json src/**/*.ts tests/**/*.ts","test":"ts-node -P tsconfig.tests.json node_modules/tape/bin/tape tests/*.ts","build:es":"tsc","build:lib":"babel es --out-dir lib && cpx \"es/*.d.ts\" lib","build":"npm run build:es && npm run build:lib","prepublish":"npm run clean && npm run lint && npm run build"},"keywords":["redux","combine","reducer"],"repository":{"type":"git","url":"git+https://github.com/aikoven/recombine.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"@types/tape":"^4.2.29","babel-cli":"^6.24.0","babel-preset-es2015":"^6.24.0","cpx":"^1.5.0","redux":"^3.6.0","rimraf":"^2.6.1","tape":"^4.6.3","ts-node":"^3.0.2","tslint":"^4.5.1","typescript":"^2.2.2"},"gitHead":"4206984d301ab955a635a3d8968d303ed900c641","bugs":{"url":"https://github.com/aikoven/recombine/issues"},"homepage":"https://github.com/aikoven/recombine#readme","_id":"@aikoven/recombine@0.1.0","_npmVersion":"5.7.1","_nodeVersion":"9.5.0","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"integrity":"sha512-qOpDtHmYqS5gXvIpHJtRqIgs3kSg++jYm878XPQ+X5z0dl9ZPacU/PcaV4CDMk4Tu5E3hDg8TJ9UcP7YGOEH6Q==","shasum":"a17f15eae14c7f774709804b6b20bfa2c37faff0","tarball":"https://registry.npmjs.org/@aikoven/recombine/-/recombine-0.1.0.tgz","fileCount":17,"unpackedSize":28242,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxAhJiiWgpzVPzeOQkj2+hNhcD2bfnr31Tkp9Zc3LXhQIhAPeIjMEenRi4HKmOJpdYHymM+ijtjj3Mb5XMVf6sLgBy"}]},"maintainers":[{"name":"aikoven","email":"dan.lytkin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/recombine_0.1.0_1521025789521_0.7010659161639161"},"_hasShrinkwrap":false},"0.2.0":{"name":"@aikoven/recombine","version":"0.2.0","description":"Utilities for combining Redux reducers","main":"lib/index.js","module":"es/index.js","typings":"lib/index.d.ts","files":["src","es","lib"],"scripts":{"clean":"rimraf lib es","lint":"tslint -c tslint.json src/**/*.ts tests/**/*.ts","test":"ts-node -P tsconfig.tests.json node_modules/tape/bin/tape tests/*.ts","build:es":"tsc","build:lib":"babel es --out-dir lib && cpx \"es/*.d.ts\" lib","build":"npm run build:es && npm run build:lib","prepublish":"npm run clean && npm run lint && npm run build"},"keywords":["redux","combine","reducer"],"repository":{"type":"git","url":"git+https://github.com/aikoven/recombine.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"@types/tape":"^4.2.29","babel-cli":"^6.24.0","babel-preset-es2015":"^6.24.0","cpx":"^1.5.0","redux":"^3.6.0","rimraf":"^2.6.1","tape":"^4.6.3","ts-node":"^3.0.2","tslint":"^4.5.1","typescript":"^2.2.2"},"gitHead":"556b1a6629096c6497f3d4d991e2bcde4abc3b00","bugs":{"url":"https://github.com/aikoven/recombine/issues"},"homepage":"https://github.com/aikoven/recombine#readme","_id":"@aikoven/recombine@0.2.0","_npmVersion":"5.6.0","_nodeVersion":"10.0.0","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"integrity":"sha512-zWuBhD5j+byzD2XolZq5DvOqpgVTlU3hT8A8dbvitJ6KRprLcDp3PId9qR1ivDKXpeGTlP1EMk+dmmN94zrDnw==","shasum":"4516fb02a63c8fa284d4dccfdc1e0be25d4b2f41","tarball":"https://registry.npmjs.org/@aikoven/recombine/-/recombine-0.2.0.tgz","fileCount":22,"unpackedSize":25105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa9TiOCRA9TVsSAnZWagAAmzEP/R193wITesa9wpAgfxWd\nD/t9XeFOjxd8uykh/Qg+vKkehp0NknyetcD8uY/8bs4AbwGHmx6oMRujaj6T\n2jpOEex4wbQiWBmeMr7uqQ0ck9ecF//pnf+MhQGEWFOGRPuNzK3UMRZLgOzs\nu39jRkXL5wZv4VlAfnpJVpPIMqxgqrZKhZxG5d60GXE/nx/KZGjq/XD9qVaK\n27RLB2lRu5351xQetd3i7Hq65KXshwD7p6BH24ZzkEgYq1qs1Uk0ceFsSjgC\nQRp1s5AeW17PVRS+/ArALpVZbuVXmv+KDP7o7kTaqmWCUZr7xnZzNWNEk9i4\nBjg8xR7iVSdRRjaOk+6m0Ra9jgafsEMBKlnEyi0x7TW2c659VDftrKGqYFuP\nWQPWvmD/MBpSTBaTgCcFmQ8dwsEgt4NT+b07vCDP6GrtpgOlmyojWJZ4aPTR\nDMwiL+iA97FxSotQKmr5Ch+d72vLBshRBSz96XtJ8XmlF4NksxCYGE1+Sycr\nrGDfvlfQ30FjNXkQbjmTMydqHYvaqd+7qQR4mtvZ77n88Ecuf7i8YKoCiGfl\n2ZbH9eEmHUz4pg46ud1TIJsRrOUMeJVc9MSF1ah8Wxg/algGL+RYhOxPWw9p\nuVE2oxKLt85CcJeGeIe6xn2u/YAkE9oKX/XftMa5jTN4vMMIhqqwtyTYu5mg\nDA83\r\n=zswn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFt4rRhSPqMf1rqWzVtB/cuGX5YQAxr9bc2Y320FiZ0tAiBw5+5rTauP3EbOijut8fMTmCvLZrBPMOhKG0Z6rcu5yw=="}]},"maintainers":[{"name":"aikoven","email":"dan.lytkin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/recombine_0.2.0_1526020237693_0.9572560330922089"},"_hasShrinkwrap":false},"0.2.1":{"name":"@aikoven/recombine","version":"0.2.1","description":"Utilities for combining Redux reducers","main":"lib/index.js","module":"es/index.js","typings":"lib/index.d.ts","files":["src","es","lib"],"scripts":{"clean":"rimraf lib es","lint":"tslint -c tslint.json src/**/*.ts tests/**/*.ts","test":"ts-node -P tsconfig.tests.json node_modules/tape/bin/tape tests/*.ts","build:es":"tsc","build:lib":"babel es --out-dir lib && cpx \"es/*.d.ts\" lib","build":"npm run build:es && npm run build:lib","prepublish":"npm run clean && npm run lint && npm test && npm run build"},"keywords":["redux","combine","reducer"],"repository":{"type":"git","url":"git+https://github.com/aikoven/recombine.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"license":"MIT","devDependencies":{"@types/tape":"^4.2.29","babel-cli":"^6.24.0","babel-preset-es2015":"^6.24.0","cpx":"^1.5.0","redux":"^3.6.0","rimraf":"^2.6.1","tape":"^4.6.3","ts-node":"^6.1.1","tslint":"^5.10.0","typescript":"^2.9.1"},"gitHead":"0bb81e1f49f1be4870e7691ec1b4745a52ffae77","bugs":{"url":"https://github.com/aikoven/recombine/issues"},"homepage":"https://github.com/aikoven/recombine#readme","_id":"@aikoven/recombine@0.2.1","_npmVersion":"5.6.0","_nodeVersion":"10.2.1","_npmUser":{"name":"aikoven","email":"dan.lytkin@gmail.com"},"dist":{"integrity":"sha512-9rbsO6M2nFDYmORvUE2Edj5QM5yRX1rJ9bt45mM1f1L/mMQH88uD+CfxBcP94zq4I3fX6H6J41MpkvqYPsZkuw==","shasum":"70aeaaf439be672f65b517775ae6f9d04270f152","tarball":"https://registry.npmjs.org/@aikoven/recombine/-/recombine-0.2.1.tgz","fileCount":22,"unpackedSize":25196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIOPrCRA9TVsSAnZWagAAlE8P/2cj49VUyQantyYFBXqt\nu/IR51vxhmeHQy4+rZ3m/Kif4wLa262q6N7ZWFFmVxgfZVJgC9rP6j3EpOKm\ncwEb5rbxeGkeB0dKxvY38uTbArlsfAn1OAy2CJK44q7kX3AbfntsjX9JO0ad\naD+PceLOerCgIcTb+OnilAdRy94a4XeGXmSRENM6WtmAQ9iJUTWI/IT1YzvK\ndNOjpLXAm9kMOeFatWZNocMVnRTyw2+t6sUOiODH5A1jSNQRJlbuzZN0TafD\nB8+ou4YIClcd1UYqphnvZ6l1p6YCoPyDvxs44zfE5OTf3evUdoFtwbMBXYMG\nbIBZ3RIBb2oUsiU62EdQSNIySbBd0g0Zh04rHvsvdNV/aU7i7R8pQ9eWKXt1\nRuEspN6yrEEJjRO8u+atQvOGBXJxK3/sC6+8uE4ynspHxIKbKupV2Sux83Zi\nF3NzU9Y9v3rytHhTtOXhwKqT8EfLae2C0KZGOndHPlCB2f3UPU/Ubf6P7K0U\neifMLzxylK7uAndOrCgS47nUq4NI4+hCyYcnvb//D7tuSe+z1whhZAIZ4zB8\nMbS7fdPXSUt/RYQsCC0iETQGeXAb+69KSQhfdw98m/RwhxuRq3zp4e39AmYO\nR/oAvpyByhcbcYxP3jgwRt5vA0w/pPx5E4a97DPhOZ/Zf+GhWhCCFmWmuSLt\nj9qD\r\n=KUaA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfHWNPptq/iGnGUij7ByATe/1fgODTkUK0Hx8EuTKJSwIhANNgwzLUz7aPfDlLIApfcAVH99vqWiIl2/8sCa5lXq8T"}]},"maintainers":[{"name":"aikoven","email":"dan.lytkin@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/recombine_0.2.1_1528882154514_0.8211822420487047"},"_hasShrinkwrap":false}},"time":{"created":"2018-03-14T11:09:49.470Z","0.1.0":"2018-03-14T11:09:49.564Z","modified":"2022-04-04T12:18:17.017Z","0.2.0":"2018-05-11T06:30:37.773Z","0.2.1":"2018-06-13T09:29:14.613Z"},"maintainers":[{"name":"aikoven","email":"dan.lytkin@gmail.com"}],"description":"Utilities for combining Redux reducers","homepage":"https://github.com/aikoven/recombine#readme","keywords":["redux","combine","reducer"],"repository":{"type":"git","url":"git+https://github.com/aikoven/recombine.git"},"author":{"name":"Daniel Lytkin","email":"dan.lytkin@gmail.com"},"bugs":{"url":"https://github.com/aikoven/recombine/issues"},"license":"MIT","readme":"# Recombine [![npm version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]\n\nUtilities for combining Redux reducers\n\n## Installation\n\n```\nnpm install --save @aikoven/recombine\n```\n\n## API\n\n### `combineReducers(reducers: ReducerMapObjectWithExtraArgs): ReducerWithExtraArgs`\n\nSame as original `combineReducers` from Redux but returned reducer accepts extra\narguments and passes them to each child reducer.\n\n**Example**\n\nConstruct reducer that manages state where one branch depends on another:\n\n```js\nimport {combineReducers} from \"@aikoven/recombine\";\n\n// for regular reducers `combineReducers` behaves exactly the same as original\nconst firstBranchReducer = combineReducers({\n  something(state = ..., action) {/*...*/},\n  somethingElse(state = ..., action) {/*...*/},\n});\n\n// created reducer forwards any extra args to child reducers\nconst secondBranchReducer = combineReducers({\n  someKey(state = ..., action, firstBranch) {/*...*/},\n  anotherKey(state = ..., action, firstBranch) {/*...*/},\n});\n\nconst reducer = (state = {}, action) => {\n  // compute first branch and pass results to the second branch\n  const {firstBranch, secondBranch} = state;\n\n  const nextFirstBranch = firstBranchReducer(firstBranch, action);\n  const nextSecondBranch = secondBranchReducer(secondBranch, action, nextFirstBranch);\n\n  if (nextFirstBranch !== firstBranch || nextSecondBranch !== secondBranch)\n    return {firstBranch: nextFirstBranch, secondBranch: nextSecondBranch};\n\n  return state;\n};\n```\n\n### `dictionaryReducer(childReducer: Reducer, addKey?: Function, removeKey?: Function, initialState?: Object): Reducer`\n\nCreate reducer that manages key-value dictionary state with values of same\nshape. Child reducer is called on every action for each dictionary value, and\ndictionary key is supplied to the child reducer as third argument.\n\nAny extra arguments for resulting reducer are passed to the child reducer\nfollowing dictionary key.\n\n**Parameters**\n\n* `childReducer`:   Reducer for dictionary values. Receives dictionary key as\n                    third argument.\n* `addKey?`:        Function that will be called on every action to determine\n                    whether that action should result in adding a new key to the\n                    dictionary, in which case it should return the key.\n* `removeKey?`:     Function that will be called on every action to determine\n                    whether that action should result in removing a key from the\n                    dictionary, in which case it should return the key.\n* `initialState = {}`: Initial state for resulting reducer.\n\n## Roadmap\n\n* More documentation covering rationale and use cases.\n* More tests\n\n[npm-image]: https://badge.fury.io/js/%40aikoven%2Frecombine.svg\n[npm-url]: https://badge.fury.io/js/%40aikoven%2Frecombine\n[travis-image]: https://travis-ci.org/aikoven/recombine.svg?branch=master\n[travis-url]: https://travis-ci.org/aikoven/recombine","readmeFilename":"README.md"}