<commit_before># Reflux

A simple library for uni-directional dataflow architecture inspired by ReactJS [Flux](http://facebook.github.io/react/blog/2014/05/06/flux.html).

## Installation

You can currently install the package as a npm package:

    npm install reflux

## Usage

Create an action by calling `createAction`.

```javascript
var Reflux = require('reflux');

var statusUpdate = Reflux.createAction();
```

Create a data store by passing a definition object to `createStore`.

```javascript
// Creates a DataStore
var statusStore = Reflux.createStore({
<commit_msg>Updated readme with info on bower component and some differences with flux<commit_after># Reflux

A simple library for uni-directional dataflow architecture inspired by ReactJS [Flux](http://facebook.github.io/react/blog/2014/05/06/flux.html).

You can read an overview of Flux [here](http://facebook.github.io/react/docs/flux-overview.html), however the gist of it is to introduce a more functional programming style architecture by eschewing MVC like pattern and adopting a single data flow pattern. The pattern is composed of dispatching actions and data stores. Every data manipulating event needs to pass through the actions that will then appropriately dispatch the event among the data stores that listen to relevant actions.

The goal of the project is to get this architecture easily up and running in your web application, both client-side or server-side. And there are some differences between how this project works and how Facebook's variant works:

* Every action is a listenable event handler, essentially incorporating the singleton dispatcher inside each one of them
* No more type checking with strings! Since data stores know what actions they listen to, they should do just that and let the actions dispatch accordingly.
* Data stores are also listenable event handlers, and you may build an aggregate data store by listening to changes made by other data stores.

## Installation

You can currently install the package as a npm package or bower.

### NPM

The following command installs reflux as an npm package:

    npm install reflux

### Bower

The following command installs reflux as a bower component that can be used in the browser:

    bower install reflux

It will also download lodash as a dependency.

## Usage

Create an action by calling `createAction`.

```javascript
var Reflux = require('reflux');

var statusUpdate = Reflux.createAction();
```

Create a data store by passing a definition object to `createStore`.

```javascript
// Creates a DataStore
var statusStore = Reflux.createStore({

{'fraction_non_alphanumeric': 0.06134969325153374, 'fraction_numerical': 0.006134969325153374, 'mean_word_length': 4.659436008676789, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1576593', 'n_tokens_mistral': 686, 'n_tokens_neox': 624, 'n_words': 343}