- Notifications
You must be signed in to change notification settings - Fork35
f/delorean
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
DeLorean is a tiny Flux pattern implementation.
- Unidirectional data flow, it makes your app logicsimpler than MVC,
- Automatically listens to data changes and keeps your data updated,
- Makes data moreconsistent across your whole application,
- It's framework agnostic, completely. There'sno view framework dependency.
- Very small, just5K gzipped.
- Built-inReact.js integration, easy to use withFlight.js andRactive.js and probably all others.
- Improve your UI/data consistency usingrollbacks.
You can learn Flux and DeLorean.js in minutes.Read the tutorial
You can installDeLorean with Bower:
bower install delorean
You can also install by NPM to use withBrowserify(recommended)
npm install delorean
Hipster way:
varFlux=require('delorean').Flux;// ...
Old-skool way:
<scriptsrc="//rawgit.com/f/delorean/master/dist/delorean.min.js"></script><script>varFlux=DeLorean.Flux;// ...</script>
varFlux=DeLorean.Flux;/* * Stores are simple data buckets which manages data. */varStore=Flux.createStore({data:null,setData:function(data){this.data=data;this.emit('change');},actions:{'incoming-data':'setData'}});varstore=Store;/* * Dispatcher are simple action dispatchers for stores. * Stores handle the related action. */varDispatcher=Flux.createDispatcher({setData:function(data){this.dispatch('incoming-data',data);},getStores:function(){return{increment:store};}});/* * Action Creators are simple controllers. They are simple functions. * They talk to dispatchers. They are not required. */varActions={setData:function(data){Dispatcher.setData(data);}};// The data cycle.store.onChange(function(){// End of data cycle.document.getElementById('result').innerText=store.data;});document.getElementById('dataChanger').onclick=function(){// Start data cycle:Actions.setData(Math.random());};
You can read thetutorial to get startedDeLorean.js with your favorite framework.
- Store: A postbox
- Dispatcher: The postman, drops mail in the postboxes
- View (or Component): Box owner, checks the box for mail
- Action Creator: The post office, manages postmen
Or you can visitdocuments page.
There is a simple TodoMVC example working with DeLorean.js
cd examples/todomvcgruntopen index.html- Fatih Kadir Akin@f
- Burak Can@burakcan
- Darcy Adams@darcyadams
- Tom Moor@tommoor
- Tim Branyen@tbranyen
- Quang Van@quangv
- James H. Edwards@incrediblesound
- Fehmi Can Sağlam@fehmicansaglam
- Serge van den Oever@svdoever
- Markus Ast@rkusa
- Peter Rumenov Denev@peterdenev
git clone git@github.com:deloreanjs/delorean.gitcd deloreangit checkout -b your-feature-branchAfter you make some changes and add your test cases to thetest/spec/*Spec.jsfiles. please run:
gruntgrunttestWhen it's all OK,open a pull request.
Theflux capacitor was the core component of Doctor Emmett Brown'sDeLorean time machine
- http://dailyjs.com/2014/08/19/delorean-cash/
- https://reactjsnews.com/the-state-of-flux/
- http://facebook.github.io/react/blog/2014/10/17/community-roundup-23.html
- https://scotch.io/tutorials/getting-to-know-flux-the-react-js-architecture
- http://thewebplatform.libsyn.com/flux-application-architecture-react
About
An Agnostic, Complete Flux Architecture Framework
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.