redux-dynamic-modules icon indicating copy to clipboard operation
redux-dynamic-modules copied to clipboard

Merge some reducers or another way adding some reducers

Open RavilM opened this issue 6 years ago • 0 comments

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: image

RavilM avatar Oct 21 '19 14:10 RavilM