Need help with flux?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

17.2K Stars 3.6K Forks Other 455 Commits 10 Opened issues


Application Architecture for Building User Interfaces

Services available


Need anything else?

Contributors list

⚠️ The Flux project is in maintenance mode and there are many more sophisticated alternatives available (e.g. Redux, MobX) and we would recommend using them instead.



An application architecture for React utilizing a unidirectional data flow.
Licence Badge Current npm package version.

Getting Started

Start by looking through the guides and examples on Github. For more resources and API docs check out

How Flux works

For more information on how Flux works check out the Flux Concepts guide, or the In Depth Overview.


Flux is more of a pattern than a framework, and does not have any hard dependencies. However, we often use EventEmitter as a basis for

and React for our
. The one piece of Flux not readily available elsewhere is the
. This module, along with some other utilities, is available here to complete your Flux toolbox.

Installing Flux

Flux is available as a npm module, so you can add it to your package.json file or run

npm install flux
. The dispatcher will be available as
and can be required like this:
const Dispatcher = require('flux').Dispatcher;

Take a look at the dispatcher API and some examples.

Flux Utils

We have also provided some basic utility classes to help get you started with Flux. These base classes are a solid foundation for a simple Flux application, but they are not a feature-complete framework that will handle all use cases. There are many other great Flux frameworks out there if these utilities do not fulfill your needs.

import {ReduceStore} from 'flux/utils';

class CounterStore extends ReduceStore { getInitialState(): number { return 0; }

reduce(state: number, action: Object): number { switch (action.type) { case 'increment': return state + 1;

  case 'square':
    return state * state;

    return state;

} }

Check out the examples and documentation for more information.

Building Flux from a Cloned Repo

Clone the repo and navigate into the resulting

directory. Then run
npm install

This will run Gulp-based build tasks automatically and produce the file Flux.js, which you can then require as a module.

You could then require the Dispatcher like so:

const Dispatcher = require('path/to/this/directory/Flux').Dispatcher;

The build process also produces de-sugared versions of the

modules in a
directory, and you can require those modules directly, copying them into whatever directory is most convenient for you. The flux-todomvc and flux-chat example applications both do this.

Join the Flux community

See the CONTRIBUTING file for how to help out.


Flux is BSD-licensed. We also provide an additional patent grant.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.