What is the core difference of redux & reflux in using react based application?

Zahid Rahman picture Zahid Rahman · Mar 31, 2016 · Viewed 22.3k times · Source

Recently I conducted a preliminary study on developing an E-commerce site and discovered that redux and reflux both come from flux architecture in Facebook and that both are popular. I am confused about the difference between the two.

When should I use redux vs reflux, and which is most flexible during the development phase of an e-commerce web application?

Answer

Mijamo picture Mijamo · Mar 31, 2016

Flux, Reflux and Redux (and many other similar libraries) are all different ways to handle transversal data management.

Basic React components work fine with parent-children relationships, but when you have to provide and update data from different parts of the app which are not directly connected it can become quickly messy. Those libraries provide stores and actions (and other mechanisms) to maintain and update such data.

Flux is the original solution developed by Facebook (just like React), it is powerful but probably not the easiest or readable. Reflux was developed partly to make it easier and clearer. The main difference is that in Reflux every piece of data has its own store and actions, which make it very readable and easy to write. Unfortunately Reflux is not so much actively developed anymore, the author is looking for maintainers. But all in all I would say Reflux is a more elegant alternative to Flux.

Redux is another solution, which has become the most popular so far. Its advantage is that it provide nested stores with immutable content so that you can easily implement previous/next feature and have transversal actions that have impact on many parts of the store. The disadvantages of redux are that it is quite verbose and has many more concepts than Flux or Reflux. For the same basic actions it will need much more code, and the async implementation is not the cleanest. It is definitively powerful and scalable.

Here is a link that talks about it more extensively: http://jamesknelson.com/which-flux-implementation-should-i-use-with-react/