Flux implementation in Angular 1, used in production at Rise
demos/simple-todo/index.html
& demos/simple-todo/todo-app.js
for to
see it in action.
angular-flux.js
contains the pieces that you need to get going with
the Flux architecture in Angular. Just download it and include it in
your app with the module ngFlux
. Install it through bower with
bower install angular-flux-helpers --save
.
FluxUtil
packages a couple of functions to reduce boilerplateFluxUtil.defineConstants
defines constants for you.FluxUtil.createDispatcher
creates a dispatcher from Facebook'sdispatcher.js
prototype and adds ahandleViewAction
function to it.FluxUtil.createStore
creates an object based the node.jsEventEmitter
prototype, with a few useful helpers tacked on, such asbindState(scope, callback)
that will add a change listener to the store and execute the callback on change - it also safely removes this listener when the scope is destroyed.- The
localize-state
directive creates a one way data binding, so changes propagate down but not up, allowing you to keep the data in sync with wider application changes while controlling when the local state triggers an action. This directive is not needed to propagate changes, normal angular data-binding works better.
todo-app.js and it will make sense if you're already familiar with the Flux architecture.
Flix is an Android app (based on the Ionic Framework) that uses angular-flux. See /frontend/www/js/
- Implement the flux-chat example app