question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make sure v2 works with applyMiddlaware

See original GitHub issue

Right now the only way to use the syncMain is to pass it as storeEnchancer to store creator:

const store = createStore(reducer, syncMain)

Its not possible to use it with applyMiddleware (probably need to applyMiddleware + compose - but it might be more

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
sneljo1commented, Dec 7, 2020

I had to do 2 things, but I do not fully understand why. I believe that indeed the actions are dispatched in the other process, but they weren’t picked up by the middleware when coming from the other process. I think this issue is specifically for actions which need to be dispatched and run inside the middleware of the renderer process, but I have to do more testing to be sure. With the fixes, they do dispatch and get handled correctly. Firstly, for the compose, I had to place my middleware first, then the other enhancers. Then, I patched the package like this image

0reactions
sneljo1commented, Dec 8, 2020

@matmalkowski Allright, I will. I also did some more investigating into my other issue. It is possibly related specifically to the usage with redux-observable. I hope I can provide some input and possible fix for this soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

applyMiddleware - Redux
Each middleware receives Store 's dispatch and getState functions as named arguments, and returns a function. That function will be given the ...
Read more >
javascript - How does react redux's #applyMiddleware ensure ...
It returns a new #createStore, but this method can be used as a parameter again in another #applyMiddleware just as store can be...
Read more >
API Reference: ApolloServer - Apollo GraphQL Docs
This article documents the ApolloServer class from the @apollo/server package. You can use the ApolloServer class to create an instance of Apollo Server ......
Read more >
middleware is not a function · Issue #35 · reduxjs/redux-thunk
I have a store like this: const store = compose( applyMiddleware( thunk, ... Also make sure you're using 2.x.
Read more >
Redux Middleware/Async/Thunk: The complete Guide
This video I will be covering middleware and asynchronous actions within React/Redux. We'll cover why we need to ... 44K views 2 years...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found