Redux, combineReducers and allowing slice reduces to access other parts of the state tree
If you need a redux reducer that adds some "injectables" as the third argument to the reducers normally combined in redux's combineReducers, try this one: /** * A combineReducers replacement that adds additional arguments * to the reduction call to inject different values a reducer * might need, read-only, from other parts of the tree. Reducer * order calling is not specified. If no injectables are provided * the overall state is included under the key "_root_". * * @param {Object} reducers Reducer object. Each key with a function is included in a final reducer. * @param {Object} injectables Key-Functions. All functions are called with the overall state and * current action. The results are attached to an object under their original keys. * Non-function values are ignored. * @param {string} rootName The name of the root that is attached if injectables is empty. */ export function combineReducers ( reducers , injectabl...