TinyFlux
TinyFlux is a predictable state container for JavaScript apps.
It is very very tiny,just 150 line source code and has no dependencies
You can read an overview of ReFlux here
╔═════════╗ ╔════════╗ ╔═════════════════╗
║ Actions ║──────>║ Stores ║──────>║ View Components ║
╚═════════╝ ╚════════╝ ╚═════════════════╝
^ │
└──────────────────────────────────────┘
Hower when we write more reflux , we will find action is more unnecessary.
action is almost equal the store method!
we always copy store method to action for declare action,so unnecessary.
╔════════╗ ╔═════════════════╗
║ Stores ║──────>║ View Components ║
╚════════╝ ╚═════════════════╝
^ │
└───────────────────┘
So this is the tinyflux architecture
we no longer declare action ever
action is generate by store method!
less is more!
Install
npm install --save tinyflux
Examples
How To Use
ONLY 1 MINUTE , YOU KNOW EVERYTHING ABOUT TINYFLUX
Store
; //1.create Store by TinyFlux.createStore//2.set your action function//3.set your get function//ok that's alllet Store = TinyFlux; ;
Component
//1.create Component by TinyFlux.createComponent//2.create mapStateToProps for map store data to component data//3.connect 1 and 2 //ok that's alllet Component = TinyFlux; { return counter:Store };
License
MIT