{"_id":"redux-injectors","_rev":"10-11ff331a42bb0de7bceddd298a2030ae","time":{"1.1.0":"2019-09-27T00:14:04.197Z","created":"2019-09-28T03:29:09.873Z","1.0.0":"2019-09-28T03:29:10.300Z","modified":"2022-11-22T13:11:55.648Z","1.2.0":"2019-10-24T14:43:59.613Z","1.3.0":"2020-01-27T15:31:30.335Z","2.0.0-rc":"2021-06-10T23:30:17.985Z","2.0.0":"2022-05-30T02:06:12.979Z","2.1.0":"2022-11-22T13:11:55.478Z"},"name":"redux-injectors","dist-tags":{"latest":"2.1.0","next":"2.0.0-rc"},"versions":{"1.0.0":{"name":"redux-injectors","version":"1.0.0","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.5.5","@babel/core":"7.5.5","@babel/plugin-proposal-class-properties":"7.5.5","@babel/plugin-transform-modules-commonjs":"7.5.0","@babel/plugin-transform-react-constant-elements":"7.5.0","@babel/plugin-transform-react-inline-elements":"7.2.0","@babel/preset-env":"7.5.5","@babel/preset-react":"7.0.0","@testing-library/react":"8.0.9","babel-eslint":"10.0.3","bili":"4.8.1","core-js":"3.2.1","documentation":"12.1.1","eslint":"6.2.2","eslint-config-airbnb":"18.0.1","eslint-config-prettier":"6.1.0","eslint-plugin-import":"2.18.2","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.0","eslint-plugin-react":"7.14.3","eslint-plugin-react-hooks":"1.7.0","eslint-plugin-redux-saga":"1.1.0","husky":"3.0.4","jest-cli":"24.9.0","lint-staged":"9.2.5","prettier":"1.18.2","react":"16.9.0","react-dom":"16.9.0","react-redux":"7.1.1","react-test-renderer":"16.9.0","redux-saga":"1.0.5","regenerator-runtime":"0.13.3"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.0","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.1"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["eslint --fix","git add"]},"gitHead":"ed31c5096d4fcfa1f5be74ebb1927c7c58addcf8","description":"Dynamically load [redux](https://redux.js.org/) reducers and [redux-saga](https://redux-saga.js.org/) sagas as needed, instead of loading them all upfront. This has some nice benefits, such as avoiding having to manage a big global list of reducers and sa","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"},"homepage":"https://github.com/react-boilerplate/redux-injectors#readme","_id":"redux-injectors@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.16.1","_npmUser":{"name":"benlorantfy","email":"ben@benlorantfy.com"},"dist":{"integrity":"sha512-RenGqRa77l7DDIxuTWJmtX1QlA94KhdnsalAgVZhtpr7O5WzZFxs4KhIvilhiBKS3o7CI01qb1boTCj0oAC/4Q==","shasum":"524f62db47b78b370a03bc83d36fdf3f59fc6956","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-1.0.0.tgz","fileCount":6,"unpackedSize":44218,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdjtOGCRA9TVsSAnZWagAAXSIP/RLDJMN+xrypbQWA9rIN\nNJTYYb5RU/Db2ipTs7veQHZz3r7oKL9t0z5aVdSbOvC7nkj3dUjUmnGgztu1\nmkRX02vG6yBx8yZPm5FhF1ByCLpZD80QYk9rXqqE1e+7oBu7GeHcjw+lBsKq\nE9DCw7RRnWdBmJH/k8UUwxPvQEzPpVkzboMC9cTVWiJdP4mh08R2VOl8wvB8\n4v80BRfBBdk35ZDmYqzEkemzke0lMScjTk6s7kZBOUThrpyjq0O0Q3KhrLa0\nSGlWRUcV1tD/iFPbZuCDioPV6cSFQU89hiAHL/vADQwAl2/0SViGcfoDSTrU\ntT8z41sGw//xcdh7fO7DvMbufpyGTYoTWh+6cztEDaJyOggKSzVA0iEOhLcM\nF0q3eSvFRzzShgi9aTqiVe+9ZyTPpm0EYJZWB6Q/LHs5Yt5OAv+dCDk1Mwlv\nc1IwpPl0BBiz+hGhNyD/+4gMcx3K6MGsRgCUsg7Syy6Vn52x3D40YVYPbBT5\ndV7xfF+1IXCgFG+cmjMtZ57CARbGUF8sX5mKEpxcmSnqXTKM1LtHlMX6ruNp\nnC4Br8+TWMu17dtvJ4DGddhyceq+MvEkhQs/9qcyq3hJ4RJfvIgeF3CGx78f\nBgIfUmP7KNFcCmTP46arYVRYL0orsyJFlDI8AAaZoxKIXWOy4pmkTSk/QJYM\nfJ6j\r\n=bBht\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCY/eFD1sK6yMfaGy5HTJ0u6Oo3ZFB3H89c/xEC1GrHrAIgfcUNFtpoYFYckFWW6eDmBMOzTaP718xhLG0VdEXljf8="}]},"maintainers":[{"name":"benlorantfy","email":"ben@benlorantfy.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_1.0.0_1569641350108_0.932148373630528"},"_hasShrinkwrap":false},"1.2.0":{"name":"redux-injectors","version":"1.2.0","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"./scripts/check-on-master.sh && npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.5.5","@babel/core":"7.5.5","@babel/plugin-proposal-class-properties":"7.5.5","@babel/plugin-transform-modules-commonjs":"7.5.0","@babel/plugin-transform-react-constant-elements":"7.5.0","@babel/plugin-transform-react-inline-elements":"7.2.0","@babel/preset-env":"7.5.5","@babel/preset-react":"7.0.0","@testing-library/react":"8.0.9","babel-eslint":"10.0.3","bili":"4.8.1","core-js":"3.2.1","documentation":"12.1.1","eslint":"6.2.2","eslint-config-airbnb":"18.0.1","eslint-config-prettier":"6.1.0","eslint-plugin-import":"2.18.2","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.0","eslint-plugin-react":"7.14.3","eslint-plugin-react-hooks":"1.7.0","eslint-plugin-redux-saga":"1.1.0","husky":"3.0.4","jest-cli":"24.9.0","lint-staged":"9.2.5","prettier":"1.18.2","react":"16.9.0","react-dom":"16.9.0","react-redux":"7.1.1","react-test-renderer":"16.9.0","redux-saga":"1.0.5","regenerator-runtime":"0.13.3"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.0","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.1"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["eslint --fix","git add"]},"gitHead":"62d836ca4edbd3fcde175c4bc953396960c2e5e2","description":"Dynamically load [redux](https://redux.js.org/) reducers and [redux-saga](https://redux-saga.js.org/) sagas as needed, instead of loading them all upfront. This has some nice benefits, such as avoiding having to manage a big global list of reducers and sa","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"},"homepage":"https://github.com/react-boilerplate/redux-injectors#readme","_id":"redux-injectors@1.2.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-QeyMEmBfBiS/tPMBDT8PiYfRf3hZVvldFbRUGZwvcnOv4JCgbGRwup+4ZBZtsWDyRjb8X4f1zLhtr+ACmPomLQ==","shasum":"8d4f2dd198ab3702a6aebf354100c7a112bf58b9","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-1.2.0.tgz","fileCount":6,"unpackedSize":44550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdsbiwCRA9TVsSAnZWagAAgKwQAI1PVJ0lbex3O18eBtNa\nisESQt1ZzKKlU3HfxJPQNFIZKUYEPILEfZLzrw46yd9taVGRcK7NQnpTL54h\nhpQtvleSHoXAPHDFapEDzg6woCka1rZCCdOQLK//ub1fFkVfC/CiQoBsw7Ur\nXW0EF8glJe3WZTs6C6NO+ibTwAJHa/uHu6/XseXyaEuCQGPgaHK00UzwaNGR\n1tBYh89maC39NrKr5EHtwfFfvLPULp0iK551jI4S0eJlEkQX/dkqxIgM5EE6\nXB4BEAGsyGWQPRY6fP+EMrKyg8Lc5k/SXoInhkNkMYXi2Z4262vAad9rzvLl\nCb7LtMxA4+gLHJouOMq5LG943YwnADPKqAAph66mPmM5ZkVEvG6PGvvA72X/\nr6bPyhpofe13ZSRJfpSbB26YZt0YFztFSwKyrBj3DZWSGMNI28gnkg18V/fb\nJ3uzfs+RV+netJf2q5KAfAEwKuRJz+9cCqFOagD89Rciw5giGIasl4Fk4zsy\naviV1n/g58guqye1RrzsdmMwnQ5oFgzWBIwTC9ZHeszYd7w/jQKvLr4R9aS2\ne1dX5IfKjIH73o+2x3xqz01eJ5esCCQqyhbF7iQodbTDAiaz8LnCFUk87HH7\n53QcmyYHezeOC2hK3CymvMwTmOyobXabVOgwegPV2wZip1JLvvrC7bUyOvOI\nY44m\r\n=ah22\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEWgjjoMyZugo0cnZ0fL3bomJeMgvinPidH2s4TeYOtgIhAPDa9elmu3lUctbuJ7rXMp+KL/jQOvmoKeDMKwPv5Ggz"}]},"maintainers":[{"name":"benlorantfy","email":"ben@benlorantfy.com"}],"_npmUser":{"name":"benlorantfy","email":"ben@benlorantfy.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_1.2.0_1571928239421_0.19396215572530018"},"_hasShrinkwrap":false},"1.3.0":{"name":"redux-injectors","version":"1.3.0","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"./scripts/check-on-master.sh && npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.8.3","@babel/core":"7.8.3","@babel/plugin-proposal-class-properties":"7.8.3","@babel/plugin-transform-modules-commonjs":"7.8.3","@babel/plugin-transform-react-constant-elements":"7.8.3","@babel/plugin-transform-react-inline-elements":"7.8.3","@babel/preset-env":"7.8.3","@babel/preset-react":"7.8.3","@testing-library/react":"9.4.0","babel-eslint":"10.0.3","bili":"4.8.1","core-js":"3.6.4","documentation":"12.1.4","eslint":"6.8.0","eslint-config-airbnb":"18.0.1","eslint-config-prettier":"6.9.0","eslint-plugin-import":"2.20.0","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.2","eslint-plugin-react":"7.18.0","eslint-plugin-react-hooks":"2.3.0","eslint-plugin-redux-saga":"1.1.3","husky":"4.2.1","jest-cli":"25.1.0","lint-staged":"10.0.2","prettier":"1.19.1","react":"16.9.0","react-dom":"16.9.0","react-redux":"7.1.1","react-test-renderer":"16.12.0","redux-saga":"1.1.3","regenerator-runtime":"0.13.3"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.2","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.5"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":"eslint --fix"},"gitHead":"f4accd7ad0974b3b4a2eb12583a7392d81298cc9","description":"<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"},"homepage":"https://github.com/react-boilerplate/redux-injectors#readme","_id":"redux-injectors@1.3.0","_nodeVersion":"10.17.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-ZoyKf8Y0bRqpmJImaVO3jnDKuMXTzMDp3j+b0bqtSuPAgWcHD/2P9gRr4mI1EjgCiheIyQ/JJI8yLG29ijqRaw==","shasum":"7d283633428ccbe22e165903b60f432e63da6947","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-1.3.0.tgz","fileCount":6,"unpackedSize":44836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeLwJSCRA9TVsSAnZWagAAB6YQAI+3Kw3b+fic5CV1mphB\nPDT7HE3d0lVGAxkOgKq4si2frUTM+2RASKg1rAtyNzi0QuQ7XaUHFYK6WDqu\nbesAoStbuljp2gwyjeo16NRPMlPQ3Pd5ug50loxoa08qcTGd0OXFVH+k6zkq\nfk8B4KUpW15NnxgCmfwIvj40zwoAm9cKrzkxkMzd2Px1ruutYB9QsJIwC4sC\nH7QbqqAuHfm8PLrOkZiH1veRXDXJHaj/mIG/q+OFrnLxJf/sYyi11l8kSBg2\n00EcVHIEU41IzSdpENGJwe9dB7U6iD+0QbvLC/u7aOJAnMLaHetVMBUe81CG\n0Zqfe+cd1YhpPP7OPhGgMtP0OLG4O6K8abCzE4x/XNHNFFDIZdLTOkaNLzHy\nMU6H8z1ddUjIPRsdkB9I9fZeK4lilmpLw3MxvKgV70i7ACykwfmAsnsWLHYU\n0lG0zpYWoqH7gT5RFgrHNnMlruRCLF7Nxf+/lnQvs/nfhF38oQ7RwRssfIG0\noRJpWb8+6IuXMTwBId2SXV3osR3fIKdHS5xDNeVsxI6iWZNtB1n1LG580MgD\n9bdAACGA92W/kNzQwPKhVGd/7uI/G1TLX6mxsMnM2/NutxXPwzhvAY2beE+C\nUI0uVfs3B31esmhw4DSvQjSMhsnu5mo5YrxkBJ1xFXGLKBaPIRphjbAvEu1o\nB57p\r\n=8DjL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICz+B8JN6FJJC6JT4nclk02IEY1zDsaSH+9//XLFPkLBAiAQ6bcZepp79SpL/dNbFMqyhPIj5uTo+V9zRbNkCgtCng=="}]},"maintainers":[{"email":"ben@benlorantfy.com","name":"benlorantfy"},{"email":"julienbenchetrit@gmail.com","name":"julienben"}],"_npmUser":{"name":"julienben","email":"julienbenchetrit@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_1.3.0_1580139090131_0.45300604394651645"},"_hasShrinkwrap":false},"2.0.0-rc":{"name":"redux-injectors","version":"2.0.0-rc","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","sideEffects":false,"scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"./scripts/check-on-master.sh && npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.8.4","@babel/core":"7.9.0","@babel/plugin-proposal-class-properties":"7.8.3","@babel/plugin-transform-modules-commonjs":"7.9.0","@babel/plugin-transform-react-constant-elements":"7.9.0","@babel/plugin-transform-react-inline-elements":"7.9.0","@babel/preset-env":"7.9.0","@babel/preset-react":"7.9.1","@testing-library/react":"10.0.1","babel-eslint":"10.1.0","bili":"4.8.1","core-js":"3.6.4","documentation":"12.1.4","eslint":"6.8.0","eslint-config-airbnb":"18.1.0","eslint-config-prettier":"6.10.0","eslint-plugin-import":"2.20.1","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.2","eslint-plugin-react":"7.19.0","eslint-plugin-react-hooks":"2.5.1","eslint-plugin-redux-saga":"1.1.3","husky":"4.2.3","jest-cli":"25.1.0","lint-staged":"10.0.8","prettier":"1.19.1","react":"16.13.1","react-dom":"16.13.1","react-redux":"7.2.0","react-test-renderer":"16.13.1","redux-saga":"1.1.3","regenerator-runtime":"0.13.5"},"peerDependencies":{"react":"^16.6.0","react-dom":"^16.6.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.2","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.5"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":"eslint --fix"},"gitHead":"8dac91dbd8d13937c1bb235c6bd51da2ded4059c","readme":"# <img src=\"https://raw.githubusercontent.com/react-boilerplate/redux-injectors/3d1e0d2be038bc710c5f319ca680dd6a1e88d5e8/img/logo.svg?sanitize=true\" alt=\"alt text\" width=\"400\"></img>\n<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>\n\nDynamically load [redux](https://redux.js.org/) reducers and [redux-saga](https://redux-saga.js.org/) sagas as needed, instead of loading them all upfront. This has some nice benefits, such as avoiding having to manage a big global list of reducers and sagas. It also allows more effective use of [code-splitting](https://webpack.js.org/guides/code-splitting/). See [motivation](#Motivation). As used by [react-boilerplate](https://github.com/react-boilerplate/react-boilerplate).\n\n## Getting Started\n```bash\nnpm install redux-injectors # (or yarn add redux-injectors)\n```\n\n### Setting up the redux store\nThe redux store needs to be configured to allow this library to work. The library exports a store enhancer that can be passed to the `createStore` function.\n```js\nimport { createStore } from \"redux\";\nimport { createInjectorsEnhancer } from \"redux-injectors\";\n\nconst store = createStore(\n createReducer(),\n initialState,\n createInjectorsEnhancer({\n   createReducer,\n   runSaga,\n })\n)\n```\n\nNote the `createInjectorsEnhancer` function takes two options. `createReducer` should be a function that when called will return the root reducer. It's passed the injected reducers as an object of key-reducer pairs.\n\n```js\nfunction createReducer(injectedReducers = {}) {\n const rootReducer = combineReducers({\n   ...injectedReducers,\n   // other non-injected reducers can go here...\n });\n\n return rootReducer\n}\n```\n\n`runSaga` should usually be `sagaMiddleware.run`. \n\n```js\n  const runSaga = sagaMiddleware.run;\n```\n\n### Redux DevTools\nIf you're using redux devtools, it's **important to set `shouldHotReload` to false**.  This is because otherwise, redux devtools will re-dispatch previous actions when reducers are injected, causing unexpected behavior.\n\nIf using redux-toolkit:\n```js\n  const store = configureStore({\n    devTools: {\n      shouldHotReload: false\n    }\n  })\n```\n\nIf not using redux-toolkit:\n```js\nimport { composeWithDevTools } from 'redux-devtools-extension';\n\nconst composeEnhancers = composeWithDevTools({\n  shouldHotReload: false\n});\n\nconst store = createStore(reducer, composeEnhancers(\n  ...\n));\n```\n\nUnfortunately this causes a separate issue where the action history is cleared when a reducer is injected, **but it's still strongly recommended to set `shouldHotReload` to false**.  There's an [open issue in the redux-devtools repo about this](https://github.com/reduxjs/redux-devtools/issues/378).\n\n### Injecting your first reducer and saga\nAfter setting up the store, you will be able to start injecting reducers and sagas.\n```js\nimport { compose } from \"redux\";\nimport { injectReducer, injectSaga } from \"redux-injectors\";\n\nclass BooksManager extends React.PureComponent {\n render() {\n   return null;\n }\n}\n\nexport default compose(\n  injectReducer({ key: \"books\", reducer: booksReducer }),\n  injectSaga({ key: \"books\", saga: booksSaga })\n)(BooksManager);\n\n```\n\nOr, using hooks:\n```js\nimport { useInjectReducer, useInjectSaga } from \"redux-injectors\";\n\nexport default function BooksManager() {\n  useInjectReducer({ key: \"books\", reducer: booksReducer });\n  useInjectSaga({ key: \"books\", saga: booksSaga });\n\n  return null;\n}\n```\n\n**Note:** while the above usage should work in most cases, you might find your reducers/sagas aren't being injected in time to receive an action.  This can happen, for example, if you dispatch an action inside a `useLayoutEffect` instead of a `useEffect`.  In that case, `useInjectReducer` and `useInjectSaga` return boolean flags that are `true` once the reducers/sagas have finished injecting.  You can check these before rendering children that depend on these reducers/sagas being injected.\n\n```js\nimport { useInjectReducer, useInjectSaga } from \"redux-injectors\";\n\nexport default function BooksManager(props) {\n  const reducerInjected = useInjectReducer({ key: \"books\", reducer: booksReducer });\n  const sagaInjected = useInjectSaga({ key: \"books\", saga: booksSaga });\n\n  if (!reducerInjected || !sagaInjected) {\n    return null;\n  }\n\n  return (\n    <>\n      {props.children}\n    </>\n  );\n}\n```\n\n\n## Documentation\nSee the [**API reference**](docs/api.md)  \nOr the [**example**](example)\n\n## Motivation\nThere's a few reasons why you might not want to load all your reducers and sagas upfront:\n1. You don't need all the reducers and sagas for every page. This library lets you only load the reducers/sagas that are needed for the page being viewed. This speeds up the page load time because you can take advantage of [code-splitting](https://webpack.js.org/guides/code-splitting/).  This is also good for performance after the page has loaded, because fewer reducers and sagas are running. \n2. You don't want to have to manage a big list of reducers/sagas. This library lets components inject their own reducers/sagas, so you don't need to worry about adding reducers/sagas to a global list.\n","readmeFilename":"README.md","description":"<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"},"homepage":"https://github.com/react-boilerplate/redux-injectors#readme","_id":"redux-injectors@2.0.0-rc","_nodeVersion":"10.18.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-9aPnFVizmi0A8PVNJ+MnRZCsjMccHFND2M7rFNeg3upGWNqjT5v3jXjpzyFjerS/lAJe5bLl0P4Snt5QPS7fPA==","shasum":"fe71eae4a54cf589e4ed45276ed4c04df46478e5","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-2.0.0-rc.tgz","fileCount":6,"unpackedSize":58535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwqCJCRA9TVsSAnZWagAAn40QAKSuhDnlXWumtvw7+GlC\nRD3InBEh6LnJVDQ4DEDaTOxvZC8W5FLF1/I7AGLZPCB0J/NFTkbCTNeQR89b\n6vZDFjbWXby+1QQk8B8Th0sVrzzgXPLtxYO1+dKe6PVbmviP6Xs6t/6ogebw\nkFx13MOvvs80+cAqrC2p8Ri7Uaa9SGJukPhhl7oslW3dnQ9zzc6TEPsNbIye\nt3Td+TCud6O8OI8F0cchqgm8CbYlmQs2JRwwDO9xjyrs0O1o0XJ89VApM3pI\nKJNu7VOZmU0cWTPg/j930Hb9Y2QItDZZUANncAAVIpmb4bX4MQ1IiZe8cYat\nOZM+EjwhSftpSjJ3gERXr7ZZteAFlmDGKcSLCvefhLS6sXOJXDS87fq9GWk9\nbTWJQo0AzOmmT/QIJOlaW9zMQqCID85OHmjHuy6QYbPmVK+w/t3QF4cy1ViE\nVdhHZYC/EG98HoKCn2nGjK09ts2KdlwY1BwpZpeC4/CqLQWWcIe6h3IrPLSN\nY5oemvb3GX+C2m/YmHmU28xJURGpnr1m+e7aVsv0qRGRIBNjgo7u6BWBSbDB\nS5KqaaR5F3r9MivsbXlm4GoyuMuyn43D1tZ8H2KQlFW0U3b8jze/BTopiEGT\nydXI6uO2F+q0RV5qleCx+OPx0rzut9yNXFdBhOxl2XB+WlsD1LNuRF6ZIJdA\n7gro\r\n=WaVD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBPYgUoTSi8RoBTlbJzJ0/6+txVDT+F84SaJcx35/Y9gAiEApUkeKrpiyN+x5qigU2lxGosOYLrNgSywzy95enbLm4o="}]},"_npmUser":{"name":"benlorantfy","email":"ben@benlorantfy.com"},"directories":{},"maintainers":[{"name":"julienben","email":"julienbenchetrit@gmail.com"},{"name":"benlorantfy","email":"ben@benlorantfy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_2.0.0-rc_1623367817817_0.4099536325248583"},"_hasShrinkwrap":false},"2.0.0":{"name":"redux-injectors","version":"2.0.0","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git@github.com:react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","sideEffects":false,"scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"./scripts/check-on-master.sh && npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.8.4","@babel/core":"7.9.0","@babel/plugin-proposal-class-properties":"7.8.3","@babel/plugin-transform-modules-commonjs":"7.9.0","@babel/plugin-transform-react-constant-elements":"7.9.0","@babel/plugin-transform-react-inline-elements":"7.9.0","@babel/preset-env":"7.9.0","@babel/preset-react":"7.9.1","@testing-library/react":"10.0.1","babel-eslint":"10.1.0","bili":"4.8.1","core-js":"3.6.4","documentation":"12.1.4","eslint":"6.8.0","eslint-config-airbnb":"18.1.0","eslint-config-prettier":"6.10.0","eslint-plugin-import":"2.20.1","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.2","eslint-plugin-react":"7.19.0","eslint-plugin-react-hooks":"2.5.1","eslint-plugin-redux-saga":"1.1.3","husky":"4.2.3","jest-cli":"25.1.0","lint-staged":"10.0.8","prettier":"1.19.1","react":"16.13.1","react-dom":"16.13.1","react-redux":"7.2.0","react-test-renderer":"16.13.1","redux-saga":"1.1.3","regenerator-runtime":"0.13.5"},"peerDependencies":{"react":"^16.6.0 || ^17.0.0","react-dom":"^16.6.0 || ^17.0.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.2","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.5"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":"eslint --fix"},"description":"<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>","licenseText":"MIT License\n\nCopyright (c) 2019 react-boilerplate\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"redux-injectors@2.0.0","dist":{"shasum":"4a15a4bd192b3ffe67c582374cafb5095c1e3e29","integrity":"sha512-j1AxQoQ0lNk8Q+qvYaLGV/Uo5zZkv3qTX8XJYUjCBolGtCLsA7G6ayR38uQ6Pc12c9k6WaM0FqFj5Pvj9tv/mQ==","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-2.0.0.tgz","fileCount":8,"unpackedSize":58554,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHfM3K8N/j+fJYx8umQG0f8+gM4yReEKC00rw6JdQL7/AiEAt9cnnQnMNLyqSfpEbk6RwDm8/Mym2/xmUCsjHHbjTvA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilCaVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoe6RAApMDZIjQBUf29JHKSIOnEIy4W/3O1JfV6Ok0s6tMaW+97CtnZ\r\nulRWJO94MZbyOLFLJQnQpbIKQ/+GZBsXiLMiPej82UuMVb1ZGh8ctNYWsDLr\r\n0v9oKRqAF8YQ47edBrmCqZ6FUJvdLMkVTiYdEEmBn0MSKVvddBF0peEevshz\r\nr919uhxsKmjGqpu+SkHCXHNY4VfkX2qwUHErvyAeThV8JQXWE1emXEquEaiM\r\nCmdnCfqbghTclAAtDPEogxHrDLS4vnjYoPWhtDZ2jRrkk6HjHgjiIIGsBlDJ\r\ne2n7U78RFiHq1/z68RKoDHY+/CuNputJngq8H/T1K7JqVVE2BctjOWOYngM9\r\nvVmXomkLxOgkdOdhkhuF714Wk9AYWCnAYnGZrKnwHYRUEDBcUW1MY7Gbvp73\r\ntAMRx08cZoFbPdlgG6UXDlPPRNk4skweRofqIERZZKWmI5EMfOIQXs9oIUXZ\r\nPZ/b5GKxVRfs9CjoQMK/xG78GZBXNEpu9bqzbM+Sgr8NGU3qd6Tthx++penO\r\nPOypDjpT97RKMtMONsLxMIbiOcD0dR3kMhKHM62Ui5BdsmOIRt0LHUMXsogL\r\n+s5fj+DwtVqyi6b69n1g5F6FGVHvfqCM0Wogpfl9KDjLea9BpHsVidBYNw6j\r\nlugBKcwi2DeRE9xCKiC8HnmcmAr8eOosKoE=\r\n=nHM9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"benlorantfy","email":"ben@lorantfy.com"},"directories":{},"maintainers":[{"name":"julienben","email":"julienbenchetrit@gmail.com"},{"name":"benlorantfy","email":"ben@lorantfy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_2.0.0_1653876372858_0.22239365126889532"},"_hasShrinkwrap":false},"2.1.0":{"name":"redux-injectors","version":"2.1.0","main":"dist/index.js","module":"dist/index.esm.js","types":"index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","sideEffects":false,"scripts":{"build":"bili --format cjs --format esm","build:docs":"documentation build -f md -o docs/api.md --markdown-toc ./src/index.js --access=public --config documentation.yml","test":"jest","lint":"eslint ./src","prettify":"prettier --write","prepublishOnly":"./scripts/check-on-master.sh && npm run test && npm run build"},"devDependencies":{"@babel/cli":"7.8.4","@babel/core":"7.9.0","@babel/plugin-proposal-class-properties":"7.8.3","@babel/plugin-transform-modules-commonjs":"7.9.0","@babel/plugin-transform-react-constant-elements":"7.9.0","@babel/plugin-transform-react-inline-elements":"7.9.0","@babel/preset-env":"7.9.0","@babel/preset-react":"7.9.1","@testing-library/react":"10.0.1","babel-eslint":"10.1.0","bili":"4.8.1","core-js":"3.6.4","documentation":"12.1.4","eslint":"6.8.0","eslint-config-airbnb":"18.1.0","eslint-config-prettier":"6.10.0","eslint-plugin-import":"2.20.1","eslint-plugin-jsx-a11y":"6.2.3","eslint-plugin-prettier":"3.1.2","eslint-plugin-react":"7.19.0","eslint-plugin-react-hooks":"2.5.1","eslint-plugin-redux-saga":"1.1.3","husky":"4.2.3","jest-cli":"25.1.0","lint-staged":"10.0.8","prettier":"1.19.1","react":"16.13.1","react-dom":"16.13.1","react-redux":"7.2.0","react-test-renderer":"16.13.1","redux-saga":"1.1.3","regenerator-runtime":"0.13.5"},"peerDependencies":{"react":"^16.6.0 || ^17.0.0 || ^18.0.0","react-dom":"^16.6.0 || ^17.0.0 || ^18.0.0","react-redux":"^7.1.0"},"dependencies":{"hoist-non-react-statics":"^3.3.2","invariant":"^2.2.4","lodash":"^4.17.15","redux":"^4.0.5"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":"eslint --fix"},"gitHead":"9fae3c171993ff0e25f3b4ba75857dbc6fbf7850","description":"<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"},"homepage":"https://github.com/react-boilerplate/redux-injectors#readme","_id":"redux-injectors@2.1.0","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-LwGYiUfeoNoPwmTNnjwuxfAxeeNkqQBm3rz/XMDW7DUKdUvSy+A/RBAYMcSFlgv1qX6sXQX9R+YrwHAkyJmyYg==","shasum":"b29b17d22096f024cec67ccf9f9126fa171e3354","tarball":"https://registry.npmjs.org/redux-injectors/-/redux-injectors-2.1.0.tgz","fileCount":6,"unpackedSize":58584,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpyRikbRtukkhWKiJKs8InG73qa1iHAHVtAh6OdriEtAIgYIA8ysDRHWvhmkmgh717PsHpplrKPzuRYGO/VCTz12s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjfMqbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrfag/+OpxFzHlsfJ4rLa49/w77yiHdh/XuvcBe2JzwefKVxeTtOqKk\r\noK0xF2dMcP57JT4+WCoNZKMQBCKb5/n9XvZEDBCLA+Vh3cv/JPK+3zX+YAJE\r\n4Wh17WjmJ7VUCtMlVythpxU9or98LKBiPwtcQ+CoS570nPsC/qtsOhSY9ji/\r\naANDskwWRAuh88LIASTK+0mZHYmGZObo8txWzcA6kdDfhAWHB/AgYAMz0eqw\r\nkfTBXq7OpuiL2oS6qV8ldvFoERHecbecvNudE5W1FHmN3ijRUQYGq5oJG/ZE\r\n3p+XmJcpu4Vzgah8ZIZeBmZsOgRvDb3X8BP3Hf7HGDyL2X+3IdLyqz9Wk2fP\r\noS1fOgriDvqo9YSXVvp8s58UXpBgw4xRBpi+lyX0nPQLfSp0MzsXFHw/T457\r\nlu+F69tMZBBYN2DyJ85tQYMIBweMhqBnD6kHk0zWWLtv+usC+oMN75THNAj9\r\nHBJxZVLjMbL9ytv4BHc4PBLWBSoptoAS/kglbuueLECgNVPtgvCuiHXqCHOW\r\nc7/Lwpx4T0TVsgFG4A7s+TsnXbX6OkAnmSncMegi/qBHCkcL0N00r1+Pltff\r\nN1BUE2xgoW4swy40oGJlTvJ+ok0ewzb/rm3mgQupj59SoxipSSbczEMLN4eF\r\nS811isZDnLhbfBAIZXjlmp9dKbLHD3YnsfU=\r\n=Tvyc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"benlorantfy","email":"ben@lorantfy.com"},"directories":{},"maintainers":[{"name":"julienben","email":"julienbenchetrit@gmail.com"},{"name":"benlorantfy","email":"ben@lorantfy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/redux-injectors_2.1.0_1669122715271_0.9845147113578161"},"_hasShrinkwrap":false}},"maintainers":[{"name":"julienben","email":"julienbenchetrit@gmail.com"},{"name":"benlorantfy","email":"ben@lorantfy.com"}],"description":"<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>","repository":{"type":"git","url":"git+ssh://git@github.com/react-boilerplate/redux-injectors.git"},"author":{"name":"react-boilerplate"},"license":"MIT","readme":"# <img src=\"https://raw.githubusercontent.com/react-boilerplate/redux-injectors/3d1e0d2be038bc710c5f319ca680dd6a1e88d5e8/img/logo.svg?sanitize=true\" alt=\"alt text\" width=\"400\"></img>\n<img src=\"https://travis-ci.org/react-boilerplate/redux-injectors.svg?branch=master\" alt=\"build status\"></img>\n\nDynamically load [redux](https://redux.js.org/) reducers and [redux-saga](https://redux-saga.js.org/) sagas as needed, instead of loading them all upfront. This has some nice benefits, such as avoiding having to manage a big global list of reducers and sagas. It also allows more effective use of [code-splitting](https://webpack.js.org/guides/code-splitting/). See [motivation](#Motivation). As used by [react-boilerplate](https://github.com/react-boilerplate/react-boilerplate).\n\n## Getting Started\n```bash\nnpm install redux-injectors # (or yarn add redux-injectors)\n```\n\n### Setting up the redux store\nThe redux store needs to be configured to allow this library to work. The library exports a store enhancer that can be passed to the `createStore` function.\n```js\nimport { createStore } from \"redux\";\nimport { createInjectorsEnhancer } from \"redux-injectors\";\n\nconst store = createStore(\n createReducer(),\n initialState,\n createInjectorsEnhancer({\n   createReducer,\n   runSaga,\n })\n)\n```\n\nNote the `createInjectorsEnhancer` function takes two options. `createReducer` should be a function that when called will return the root reducer. It's passed the injected reducers as an object of key-reducer pairs.\n\n```js\nfunction createReducer(injectedReducers = {}) {\n const rootReducer = combineReducers({\n   ...injectedReducers,\n   // other non-injected reducers can go here...\n });\n\n return rootReducer\n}\n```\n\n`runSaga` should usually be `sagaMiddleware.run`. \n\n```js\n  const runSaga = sagaMiddleware.run;\n```\n\n### Redux DevTools\nIf you're using redux devtools, it's **important to set `shouldHotReload` to false**.  This is because otherwise, redux devtools will re-dispatch previous actions when reducers are injected, causing unexpected behavior.\n\nIf using redux-toolkit:\n```js\n  const store = configureStore({\n    devTools: {\n      shouldHotReload: false\n    }\n  })\n```\n\nIf not using redux-toolkit:\n```js\nimport { composeWithDevTools } from 'redux-devtools-extension';\n\nconst composeEnhancers = composeWithDevTools({\n  shouldHotReload: false\n});\n\nconst store = createStore(reducer, composeEnhancers(\n  ...\n));\n```\n\nUnfortunately this causes a separate issue where the action history is cleared when a reducer is injected, **but it's still strongly recommended to set `shouldHotReload` to false**.  There's an [open issue in the redux-devtools repo about this](https://github.com/reduxjs/redux-devtools/issues/378).\n\n### Injecting your first reducer and saga\nAfter setting up the store, you will be able to start injecting reducers and sagas.\n```js\nimport { compose } from \"redux\";\nimport { injectReducer, injectSaga } from \"redux-injectors\";\n\nclass BooksManager extends React.PureComponent {\n render() {\n   return null;\n }\n}\n\nexport default compose(\n  injectReducer({ key: \"books\", reducer: booksReducer }),\n  injectSaga({ key: \"books\", saga: booksSaga })\n)(BooksManager);\n\n```\n\nOr, using hooks:\n```js\nimport { useInjectReducer, useInjectSaga } from \"redux-injectors\";\n\nexport default function BooksManager() {\n  useInjectReducer({ key: \"books\", reducer: booksReducer });\n  useInjectSaga({ key: \"books\", saga: booksSaga });\n\n  return null;\n}\n```\n\n**Note:** while the above usage should work in most cases, you might find your reducers/sagas aren't being injected in time to receive an action.  This can happen, for example, if you dispatch an action inside a `useLayoutEffect` instead of a `useEffect`.  In that case, `useInjectReducer` and `useInjectSaga` return boolean flags that are `true` once the reducers/sagas have finished injecting.  You can check these before rendering children that depend on these reducers/sagas being injected.\n\n```js\nimport { useInjectReducer, useInjectSaga } from \"redux-injectors\";\n\nexport default function BooksManager(props) {\n  const reducerInjected = useInjectReducer({ key: \"books\", reducer: booksReducer });\n  const sagaInjected = useInjectSaga({ key: \"books\", saga: booksSaga });\n\n  if (!reducerInjected || !sagaInjected) {\n    return null;\n  }\n\n  return (\n    <>\n      {props.children}\n    </>\n  );\n}\n```\n\n\n## Documentation\nSee the [**API reference**](docs/api.md)  \nOr the [**example**](example)\n\n## Motivation\nThere's a few reasons why you might not want to load all your reducers and sagas upfront:\n1. You don't need all the reducers and sagas for every page. This library lets you only load the reducers/sagas that are needed for the page being viewed. This speeds up the page load time because you can take advantage of [code-splitting](https://webpack.js.org/guides/code-splitting/).  This is also good for performance after the page has loaded, because fewer reducers and sagas are running. \n2. You don't want to have to manage a big list of reducers/sagas. This library lets components inject their own reducers/sagas, so you don't need to worry about adding reducers/sagas to a global list.\n","readmeFilename":"README.md","homepage":"https://github.com/react-boilerplate/redux-injectors#readme","bugs":{"url":"https://github.com/react-boilerplate/redux-injectors/issues"}}