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

Middleware removed if added as enhancer

Open dbartholomae opened this issue 6 years ago • 2 comments

Hi there,

I'm currently changing over a website to use redux-dynamic-modules. It also uses react-router which lead me to the following problem. It seems, middleware that gets added as an enhancer is removed, potentially by the middleware handler. This code works:

export const store = createStore({
  initialState: {},
  extensions: [{
    middleware: [routerMiddleware]
  }]
}, getLegacyModule())

while this one doesn't:

export const store = createStore({
  initialState: {},
  enhancers: [applyMiddleware(routerMiddleware)]
}, getLegacyModule())

Specifically the middleware in the second case gets only some events and then doesn't get any events from Redux.

Not sure if this is intended, but if it is, it would be good to document it.

dbartholomae avatar Oct 28 '19 16:10 dbartholomae

Did you solve this issue?

jeevasusej avatar Dec 10 '19 14:12 jeevasusej

We are still using an extension. I'm currently thinking about setting up a redux-first-history extension.

dbartholomae avatar Dec 10 '19 20:12 dbartholomae