redux-pack | Sensible promise handling and middleware for redux | State Container library
kandi X-RAY | redux-pack Summary
kandi X-RAY | redux-pack Summary
Sensible promise handling and middleware for redux. redux-pack is a library that introduces promise-based middleware that allows async actions based on the lifecycle of a promise to be declarative. Async actions in redux are often done using redux-thunk or other middlewares. The problem with this approach is that it makes it too easy to use dispatch sequentially, and dispatch multiple "actions" as the result of the same interaction/event, where they probably should have just been a single action dispatch. This can be problematic because we are treating several dispatches as all part of a single transaction, but in reality, each dispatch causes a separate rerender of the entire component tree, where we not only pay a huge performance penalty, but also risk the redux store being in an inconsistent state. redux-pack helps prevent us from making these mistakes, as it doesn't give us the power of a dispatch function, but allows us to do all of the things we were doing before.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of redux-pack
redux-pack Key Features
redux-pack Examples and Code Snippets
Community Discussions
Trending Discussions on redux-pack
QUESTION
Following the guide, I came to a sorts of middlewares are there for redux application.
Redux Thunk, Redux Promise, Redux Promise Middleware, Redux Observable, Redux Saga, Redux Pack
It is just a matter of preference around which middleware we choose. But I'm not asking for choosing a convention.
I would like to know if there are any differences between them like performance, browser support, use cases, etc. Or anything else that I'm missing with. I tried a hard research for these but not able to find any article.
So that I can consider choosing a middleware for my application. It will also be great for me to choose middleware if I know the particular use case with different middlewares.
Or, all middlewares are just conventions and I may choose any one of them for any kind of redux application (small or large)?
...ANSWER
Answered 2018-Apr-26 at 06:44From my personal experience ( I have used most of the middleware you have listed ).
Redux Saga is the way to go. It has a higher learning curve, but once you wrap your head around it, it becomes extremely powerful
Redux Saga
- Allows for separation of concerns
- Reduced Side Effects
- Cancelable tasks ( amazing )
- Parallel(like) processing
Once you understand redux saga, it becomes much easier to extend your application.
https://engineering.universe.com/what-is-redux-saga-c1252fc2f4d1
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redux-pack
The redux-pack middleware is the heart of redux-pack. As the following example shows, it installs like most middlewares:.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page