redux-dynamic-modules
redux-dynamic-modules copied to clipboard
Merge some reducers or another way adding some reducers
Hello!
My store:
transition: { bus: { .... } }
I have a situation where I need to add new reducer for store with the same “transition” key using another module:
transition: { bus: { .... }, train: { .... } }
My code first module:
export function getBusModule() {
return {
id: 'bus',
reducerMap: {
transition: reducerBus
},
};
}
Code second module:
export function getTrainModule() {
return {
id: 'train',
reducerMap: {
transition: reducerTrain
},
};
}
How can i do it?
I try did so:
export function getTrainModule() {
return {
id: 'train',
reducerMap: {
transition: {
train: reducerTrain
}
},
};
}
But i had ts error:
