Flux and React are published together in 2013 by Facebook.
The counterpart is templates + jQuery family.
Redux is a new form of Flux.
This doesn’t look like MVC in common sense, but it is reality for Facebook.
It is argued that Flux is just another form a MVC after its release.
Spaghetti of event handling hooks.
The root cause is that data flows in too many directions.
Will Flux same us from the hell?
Maybe.
Warnings: React + Flux would make you write more lines of code for small projects.
However, it keeps projects in good shape after they evolves into giant projects.
Warnings: React + Flux would make you write more lines of code for small projects.
However, it keeps projects in good shape after they evolves into giant projects.
The most important thing in software engineering is Predictable.
No more bullshit.
Let’s play with Flux game. I need 3 volunteers acting stores: Unread, ChatBox and ContactList of Facebook homepage.
Flux is hard to support Server Side rendering, because:
1. Singleton Store, Dispatcher and actions
2. No concept of “we’re done” which is required in server side rendering
Hard to do hot-reloading, Since state and store logic are combined
So many Flux-style frameworks.
A lot of implementations of Flux
Dan explains how to reduce Flux to reducers
https://www.youtube.com/watch?v=xsSnOQynTHs
Same volunteers to play same games, but in Redux this time.
One good example is Routing.
Second example could be animation.
How to choose? Flux or Redux?
Flux is not actually more superior to Redux.
Redux Constraints:
Single State Tree
Actions describes update. Reducers apply updates. If you want to update store, you have to fire an action to be handled by reducers.