middlewares and reducers notifications
See original GitHub issueHi! 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:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😉
@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