0

Flux is a unidirectional data flow originated in the React team, it hold many benefits (Undo/Redo, Easy to test, one State to the app, and more) and it would be nice to combine it with AngularJs.

Victor Savkin wrote a blog post on how to implement it using AngularJs, but he broke a basic concept of Flux by changing the store instead of re-creating a new instance of it. Another thing that bothers me is that Angular is using ng-model and data binding, using Flux means that we should not use these anymore...

Thinking about all these issues, sounds like Angular and Flux paradigmas are colliding.

Anyone ever really creating a working Angular in Flux that works (As expected)?

gilamran
  • 7,090
  • 4
  • 31
  • 50
  • Looked at Google? https://github.com/christianalfoni/flux-angular – michelem Oct 29 '15 at 15:44
  • 1
    They work together very smooth provided it is used properly, i have built a fairly large enterprise application with angularjs and flux for which i have used the above library (flux-angular). [`ng-redux`](https://github.com/wbuchwalter/ng-redux) - angular wrapper for [`redux`](https://github.com/rackt/redux) works well too. With flux you can _opt to_ get rid of 2 way bindings and other couplings between components and have them really self contained just having dependenc on the store events. – PSL Oct 29 '15 at 15:54

1 Answers1

0

With the Flux folk recommending Redux instead, whether the latter and Angular can work together is perhaps a better question. On that, they certainly can be and I recently wrote a blog post http://simonh1000.github.io/2015/10/angular2-one-way-data-binding/. I'm not sure how efficient it is as Redux complement React whereas it substitutes for some of Angular's model handling.

Simon H
  • 20,332
  • 14
  • 71
  • 128