What are differences between redux, react-redux, redux-thunk?

后端 未结 4 542
感动是毒
感动是毒 2020-12-22 17:55

I am using React + Flux. Our team is planning to move from flux to redux. Redux is very confusing for me coming from flux world. In flux control flow is sim

4条回答
  •  温柔的废话
    2020-12-22 18:32

    bellow image demonstrates how data flow in redux : how the data flows through Redux? Advantages of Redux are listed below:

    Predictability of outcome – Since there is always one source of truth, i.e. the store, there is no confusion about how to sync the current state with actions and other parts of the application. Maintainability – The code becomes easier to maintain with a predictable outcome and strict structure. Server-side rendering – You just need to pass the store created on the server, to the client-side. This is very useful for initial render and provides a better user experience as it optimizes the application performance. Developer tools – From actions to state changes, developers can track everything going on in the application in real-time. Community and ecosystem – Redux has a huge community behind it which makes it even more captivating to use. A large community of talented individuals contribute to the betterment of the library and develop various applications with it. Ease of testing – Redux’s code is mostly functions which are small, pure and isolated. This makes the code testable and independent. [Organization][2] – Redux is precise about how code should be organized, this makes the code more consistent and easier when a team works with it.

提交回复
热议问题