synapsestudios/lively — pull request #67 by synbot (2014-10-04 06:03:43+00:00)
Title: Refactor Lively to use Flux

### Acceptance Criteria
1. Lively is refactored to use a Flux-y one-way data flow

### Tasks
These aren't in order. Many will need to be done concurrently.

- Add fluxxor to package.json
- Refactor existing oauth2
- The AJAX portion of it should be extracted to a `/client.js`. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/client/scenario.js). Note that you will use `auth-gateway.js` instead of `gateway.js`. Also, give the nature of lively, we won't need separate files under a `client` subdirectory, since the one file will make requests to all endpoints.
- Update `store/oauth2` to be a fluxxor store. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/store/policy-types.js)
- Create `action/oauth.js` file that includes `request` and `oauthRequest` methods.
- Replace direct calls to oauth store methods (setOptions, setToken, request, and oauthRequest) with action calls e.g. `this.getFlux().actions.client.setOptions()`. getAuthorizationHeader is fine to call directly, since it is a getter.
- Any place where the oauth store is passed as a prop, use fluxxor instead. To do so, update top level components to use FluxMixin, and subcomponents to use ChildFluxMixin (but only if they actually need it), then you can use this.getFlux() to access the flux object.
- Create `actions.js` file. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/actions.js)
- Create `stores.js` file. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/stores.js)
- Create `flux.js` file. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/flux.js)
- Replace `application.jsx` with [`bootstrap.js`](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/bootstrap.js) and [`routes.js`](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/routes.jsx) files.
- Create `constants.js` file. [Example](https://github.com/synapsestudios/pat.usmexpat.com/blob/develop/application/constants.js)

### Additional Notes
- Issues #69 and #59 will be unblocked when this issue is resolved.
- Additional details should be added here as needed, creating this as a stub issue for two that block on it.