-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replayed actions not passed through middleware when using redux-devtools-extension #270
Comments
Yes, you're right it's the same problem as discribed in reduxjs/redux#1051. We introduced Also we have window.__REDUX_DEVTOOLS_EXTENSION__.updateStore(store) I guess instead of |
@zalmoxisus Thanks for help and fast reply! I've tested this solution with applying This seems to fix only "dispatch console": Unfortunately when I use play button on slider - actions still aren't passed through my middlewares. Any clue why it might be so? |
I'm not quite sure I understand what you want to accomplish. Monitor actions (dispatched by |
I was trying to integrate ui-router with redux using https://github.com/neilff/redux-ui-router/blob/master/src/router-middleware.js - this solution is relying on dispatching side effect from middleware to make route changes.
Thanks - I wasn't sure if you do this or re-dispatch changes So I have to proxy router structure somehow to my redux store for redux-devtools-extension to work with it(changing routes) instead of relying on side effects from middleware. Really appreciate you help @zalmoxisus ! |
Redux DevTools intentionally doesn't redispatch actions to avoid side effects. So, except that middleware, the router needs something like this. Honestly, I don't like such workarounds, so any suggestions of what we could do from our side, would be welcome. What you wanted to do is possible by connecting the router to the extension as a separate instance, but that's not an easy solution either, as you'll have to reimplement the monitor actions, and not sure that having it decoupled from your main store is the case. It seems that there's an open issue there neilff/redux-ui-router#49. |
@Machiaweliczny, what if we'd pass the action to your function whenever a monitor action is invoked: $ngReduxProvider.createStoreWith(
rootReducer,
middlewares,
[window.__REDUX_DEVTOOLS_EXTENSION__({
onMonitorAction: action => { if (action.type === 'CHANGE_LOCATION') changeLocation(action.location); }
})]) |
A simple solution would be to add middleware which would compare if the router state from the store is the same as the current route like it was implemented here. |
@zalmoxisus Thanks for all the answers. I think your first idea with |
Usually you don't want to redispatch actions for all middlewares as side effects during time travel could lead to unexpected behaviour. Aside from time travelling, you might want to support importing and skipping actions. Also we'll add the ability to reorder actions and edit the state. All of them invoke recomputing all actions.
Yes, it's just a proposal, which would require a lot of changes also in Implementing it directly in the middleware like here would be easier, but as mentioned, it could be perf wasting when not using with the extension. |
Hello, I'm trying to adopt use of redux-devtools-extension in my project but I've encountered the error from title . Would appreciate some help with the issue if possible.
I'm using Redux DevTools extension 2.11.1
along with:
When I dispatch actions through
store.liftedStore.dispatch
they aren't going through my redux middlewares stack(defined in my application asmiddlewares
). Obviously when I run actions throughstore.dispatch
everything works correctly.The same applies when using slider in redux-devtools-extension - my middleware chain doesn't receive replayed actions.
I couldn't find solution on https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/Troubleshooting.md
redux-devtools-extension is the only enhancer that I'm using, but maybe ngRedux applies it wrong?
I'm initializing store this way:
You can see how final store is composed under this link:
https://github.com/angular-redux/ng-redux/blob/3.3.0/src/components/ngRedux.js#L16
Maybe it has something to do with reduxjs/redux#1051 ? I'm trying to figure it out on my own but would appreciate some help.
The text was updated successfully, but these errors were encountered: