<commit_before># Fallout

Fallout allows you to create React components that automatically render when the relevent data changes. Some may call this "Flux-like" and I'll leave it for you the developer to label this as you see fit.

At it's core, Fallout provides an Immutable structure for the data backing the application. If you are comfortable with Immutable.js you can work with the data store directly, however, some helpers have been provided such that you don't have to use the Immutable library directly.

All changes to the data store are made in actions and that is the only place the data should be directly manipulated.

## Usage

Create some actions. These actions will be exposed to your components
as properties on `this.actions`. In the example below you would have
access to `this.actions.example.incrementCounter`. Within your actions
you will have access to the store in `this.store`.

```
Fallout.defineActionSet('example', {
  incrementCounter: function() {
    data = this.store.checkOut();
    data.counter += 1;
    this.store.checkIn(data);
  }
});
```

Create a component and mixin the `Fallout.Mixin`. Create a property
on your class definition called `watch` which can be either a
function that returns an object or just an object. The object should
have properties, each of which should have an array of keys as a value.<commit_msg>Update README to call out need for Immutable<commit_after># Fallout

Fallout allows you to create React components that automatically render when the relevent data changes. Some may call this "Flux-like" and I'll leave it for you the developer to label this as you see fit.

At it's core, Fallout provides an Immutable structure for the data backing the application. If you are comfortable with Immutable.js you can work with the data store directly, however, some helpers have been provided such that you don't have to use the Immutable library directly.

All changes to the data store are made in actions and that is the only place the data should be directly manipulated.

## Setup

Since Fallout uses `Immutable.js`, you must have it available. It will look for it using standard
module systems and finally on `window`.

```
<script src='https://cdnjs.cloudflare.com/ajax/libs/immutable/3.7.1/immutable.min.js'></script>
<script src='/fallout.js'></script>
```

## Usage

Create some actions. These actions will be exposed to your components
as properties on `this.actions`. In the example below you would have
access to `this.actions.example.incrementCounter`. Within your actions
you will have access to the store in `this.store`.

```
Fallout.defineActionSet('example', {
  incrementCounter: function() {
    data = this.store.checkOut();
    data.counter += 1;
    this.store.checkIn(data);
  }
});
```

Create a component and mixin the `Fallout.Mixin`. Create a property
on your class definition called `watch` which can be either a
function that returns an object or just an object. The object should
have properties, each of which should have an array of keys as a value.
{'fraction_non_alphanumeric': 0.06835359842260927, 'fraction_numerical': 0.001643115346697338, 'mean_word_length': 4.349736379613357, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '547807', 'n_tokens_mistral': 789, 'n_tokens_neox': 771, 'n_words': 427}