Flax
A productive flux implementation to be used with ReactJS
Flax is based on Flux
Goals
- Productivity, objectivity and clarity
- Maintain as much freedom as traditional Flux
- Common flux problems solution proposals
Why Flax?
Flax is being developed to address professional level challenges with:
- Clarity: Flax lets you write Flux in a similar way you would write an app with ReactJS, making it intuitive to learn;
- Productivity: Flax reduces the common boilerplate while not losing granularity such as the publish-subscribe stores' pattern, but still making simpler syntax possible;
- Seamlessness: with Flax, for instance, there is little difference between sync and async actions, making action creators easy to implement without additional middleware;
- Pattern-oriented: alongside with the docs, this repository is being built to also show the best unidirectional dataflow practices to be used with Flax;
- Developer tools: Flax is being designed to support the creation of user-defined development tools. See flax-devtools, as an example;
Usage
Actions
; const AppActions = Flax; ;
Stores
;; const AppStore = Flax; ;
View Controller
;;; ; const App = React; ;
getInitialState could be:
{ let num1 num2 loading error = AppStore; return num1 num2 loading error;}
Or in a cleaner code:
{ return AppStore;}
If you want less granularity, the component could be set to listen to all AppStore's events:
{ return AppStoreDEFAULT this_handleAppChange ;}
And the store event handles:
{ this;}
License
MIT