<commit_before># Vuo

## Usage

### ActionCreator

```javascript
// AuthActions.js

var ActionCreator = require("vuo").ActionCreator;

module.exports = ActionCreator.create("Auth")

  .action("login", function (username, password) {
      this.request({
          post: '/login',
          data: {
              username: username,
              password: password
          }
      });
  })
  
  .action("logout")
  
  .publicAPI();
```

### Store

```javascript
// AuthStore.js

var Store = require("vuo").Store,
    AuthActions = require('./AuthActions');
    
module.exports = Store.create({
    state: function ($) {
        $.define("token").is("null, string");
        $.define("user").is("null, string");
    },

    listeners: function ($) {
        $.on(AuthActions.LOGIN, function (payload) {
            $.setState({
                token: payload.token,
                user: payload.user
            });
        });
        $.on(AuthActions.LOGOUT, function () {
            $.setState({token: null, user: null});
        });
    },
    
    getters: function (get, $) {
        get.loggedIn = function () {
            return $.state.token ? true : false;
        }
    }
});
```

### React component

```javascript
// AuthExample.jsx

var React = require("React"),
    Vuo = require("vuo-react"),
    Form = require("vuo-react/components/form"),
    AuthStore = require('./AuthStore'),
    AuthActions = require('./AuthActions');

module.exports = React.createClass({
    mixins: [Vuo.mixin],
    
    bindStores: function () {
        Vuo.bindStates(AuthStore, ["username", "loggedIn"]);
    },
    
    render: function () {
        if (this.state.loggedIn) {
          return <div>Logged in as {this.state.username}</div>;
        }
        return (this
          <Form onSubmit={AuthActions.login}>
            <label>Username</label><input name="username" type="text"/>
            <label>Password</label><input name="password" type="password"/>
            <input type="submit" value="Log in"/>
          </Form>
        );
    }
});
```

Work on vuo-react hasn't been started yet.<commit_msg>Documentation updated<commit_after># Vuo

## Usage

### ActionCreator

```javascript
// AuthActions.js

var ActionCreator = require("vuo").ActionCreator,
    AuthActions   = new ActionCreator("Auth", module.exports);

AuthActions

  .action("login", function (form) {
      this.request({
          post: '/login',
          data: form
      });
  })
  
  .action("logout");
```

### Store

```javascript
// AuthStore.js

var Store = require("vuo").Store,
    AuthActions = require('./AuthActions');
    
module.exports = Store.create({
    state: function ($) {
        $.define("token").is("null, string");
        $.define("user").is("null, string");
    },

    listeners: function ($) {
        $.on(AuthActions.LOGIN, function (payload) {
            $.setState({
                token: payload.token,
                user: payload.user
            });
        });
        $.on(AuthActions.LOGOUT, function () {
            $.setState({token: null, user: null});
        });
    },
    
    getters: function (get, $) {
        get.loggedIn = function () {
            return $.state.token ? true : false;
        }
    }
});
```

### React component

```javascript
// AuthExample.jsx

var React = require("React"),
    Vuo = require("vuo-react"),
    Form = require("vuo-react/components/form"),
    AuthStore = require('./AuthStore'),
    AuthActions = require('./AuthActions');

module.exports = React.createClass({
    mixins: [Vuo.mixin],
    
    bindStores: function () {
        Vuo.bindStates(AuthStore, ["username", "loggedIn"]);
    },
    
    render: function () {
        if (this.state.loggedIn) {
          return <div>Logged in as {this.state.username}</div>;
        }
        return (this
          <Form action={AuthActions.login}>
            <label>Username</label><input name="username" type="text"/>
            <label>Password</label><input name="password" type="password"/>
            <input type="submit" value="Log in"/>
          </Form>
        );
    }
});
```
{'fraction_non_alphanumeric': 0.17286652078774617, 'fraction_numerical': 0.0, 'mean_word_length': 2.171935235158057, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, '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': '996226', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1207, 'n_words': 233}