Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/deloreanPublic

An Agnostic, Complete Flux Architecture Framework

NotificationsYou must be signed in to change notification settings

f/delorean

Repository files navigation

Build StatusNPM versionCoverage

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.

Tutorial

You can learn Flux and DeLorean.js in minutes.Read the tutorial

Using with Frameworks


Install

You can installDeLorean with Bower:

bower install delorean

You can also install by NPM to use withBrowserify(recommended)

npm install delorean

Usage

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>

Overview

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());};

Run this example on JSFiddle

Docs

You can read thetutorial to get startedDeLorean.js with your favorite framework.

Basic Concepts

Or you can visitdocuments page.

Running the TodoMVC example

There is a simple TodoMVC example working with DeLorean.js

cd examples/todomvcgruntopen index.html

Authors

Contributors

Contribution

git clone git@github.com:deloreanjs/delorean.gitcd deloreangit checkout -b your-feature-branch

After you make some changes and add your test cases to thetest/spec/*Spec.jsfiles. please run:

gruntgrunttest

When it's all OK,open a pull request.

License

MIT License

Name

Theflux capacitor was the core component of Doctor Emmett Brown'sDeLorean time machine

Links about DeLorean.js

About

An Agnostic, Complete Flux Architecture Framework

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors17


[8]ページ先頭

©2009-2025 Movatter.jp