randallknutson / redux-injector

Allows dynamically injecting reducers into a redux store at runtime
59 stars 14 forks source link

Added the possibility to append reducers to an existing key with one injectReducer call #3

Open mantir opened 7 years ago

mantir commented 7 years ago

E.g. if you got an object with reducer functions mediaReducer = {mediaFun1: () => {}, mediaFun2: () => {}} and want to add all the functions in the object to an existing key data in the structure of the reducers: {data: {pagesFun1: () => {}, pagesFun2: () => {}}} to get {data: {pagesFun1: () => {}, pagesFun2: () => {}, mediaFun1:() => {}, mediaFun2:() => {}}} by doing: injectReducer('data', mediaReducer);