by jefftchan · 12y ago · 0 comments
We recently adopted this architecture for a medium-scale project. The unidirectional data flow has greatly reduced code complexity for us. We're still not satisfied with our server syncing strategy. Seems like actions are the best place to sync data, but how do you deal with interdependent actions?
I'd also mention https://github.com/spoike/reflux as an implementation.
I initially thought that the suggested implementation by Facebook was a bit weird because it requires a lot of boiler plate code.
For the longest time I disliked using magic strings for type checking since it breaks the concept of polymorphism. In Javascript it is even more weird considering it is a dynamic language. So I fixed that by moving the type specifics (which in Flux's case is mostly about handling events) into the actions and stores themselves.
Thanks to a contributor we also provide a mixin for React components that adds automatic unsubscription on componentWillUnmount and provides a listenTo method in the components to subscribe to actions and stores.
It works both server-side (available at npm) and client-side (available as bower package or can be built in browserify from npm package).
ClojureScrpt/OM:
https://github.com/swannodette/om (several examples linked)
http://rigsomelight.com/2014/05/01/interactive-programming-f... (flappy bird clone)
React+Mori:
???
https://github.com/jmreidy/fluxy/tree/master/examples/todomv...
[1] http://facebook.github.io/react/docs/flux-todo-list.html#add...