DeLorean is a tiny Flux pattern implementation.
You can learn Flux and DeLorean.js in minutes. Read the tutorial
You can install DeLorean with Bower:
bower install delorean
You can also install by NPM to use with Browserify (recommended)
npm install delorean
var Flux = require'delorean'Flux;// ...
/** Stores are simple data buckets which manages data.*/var Store = FluxcreateStoredata: nullthisdata = data;thisemit'change';actions:'incoming-data': 'setData';var store = ;/** Dispatchers are simple action dispatchers for stores.* Stores handle the related action.*/var Dispatcher = FluxcreateDispatcherthisdispatch'incoming-data' data;return increment: store;;/** Action Creators are simple controllers. They are simple functions.* They talk to dispatchers. They are not required.*/var Actions =DispatchersetDatadata;;// The data cycle.storeonChange// End of data cycle.documentgetElementById'result'innerText = storestoredata;;documentgetElementById'dataChanger'// Start data cycle:ActionssetDataMathrandom;;
You can read the tutorial to get started DeLorean.js with your favorite framework.
Or you can visit documents page.
There is a simple TodoMVC example working with DeLorean.js
cd examples/todomvcgruntopen index.html
git clone firstname.lastname@example.org:deloreanjs/delorean.gitcd deloreangit checkout -b your-feature-branch
After you make some changes and add your test cases to the
files. please run:
When it's all OK, open a pull request.
The flux capacitor was the core component of Doctor Emmett Brown's DeLorean time machine