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.

middlewares and reducers notifications

See original GitHub issue

Hi! I happen to be developing an app using this library (thanks for this, btw!) and, after a thorough debugging process, I have spotted that all my reducers and middlewares get called on every new Action dispatch.

Thus, regardless which Activity or Fragment I am, any store.dispatch(MyAction()) triggers all reducer and middleware instances (I guess this means that I could even define all reducers and middlewares in the same file). Apart from finding this a bit inefficient, I wonder whether this is the only way to do it or there is a smarter approach.

Thanks and regards,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
monday8amcommented, Jun 5, 2018

hi @pablodeafsapps , I’m using ReKotlin right now and I have used ReSwift before. It is true that not all apps are suitable for this pattern but it is something you have to decide, together with you preferences about how to write code (more or less functional) . I wrote a post about it recently, hope it helps a bit.

Using Reswift and iOS you don’t have to think too much because the state is kept in memory the whole time, but in Android you should take in account activities lifecycle, etc. IMO a single activity app is a better setup but again, it is another decision you’ll have to take 😉

0reactions
kaustavjaiswalcommented, Apr 24, 2019

@pablodeafsapps Closing this issue for now, as no further action is needed, if anyone comes up with a way to solve this, feel free to raise a PR

Read more comments on GitHub >

github_iconTop Results From Across the Web

A redux middleware to handle UI Notification events - GitHub
Notification middleware for redux. A simple middleware for handling notifications using redux store. How to use. install package yarn add ...
Read more >
redux-notifications-middleware - npm
Notification middleware for redux. A simple middleware for handling notifications using redux store. How to use. install package yarn add ...
Read more >
How to Use Redux Middleware to Better Control Your Data ...
Reducer creates a new state based on data passed through the action; The new state is passed back into the React app via...
Read more >
Redux state driven notification components for React
React-redux-notifications is a redux middleware powered notification system which makes this super easy in a decoupled way.
Read more >
Redux Fundamentals, Part 4: Store
Typically, a middleware will check to see if the action is a specific type that it cares about, much like a reducer would....
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