An open API service indexing awesome lists of open source software.

https://github.com/thetechnocrat-dev/fast-flux-react

removes a lot of the boilerplate code needed when following react flux
https://github.com/thetechnocrat-dev/fast-flux-react

Last synced: 2 months ago
JSON representation

removes a lot of the boilerplate code needed when following react flux

Awesome Lists containing this project

README

        

# fast-flux-react

## docs
require at top of component you want to use

ex/ var FastFlux = require('../util/fast-flux-react/fastFlux')

then do FastFlux.webCycle(method, url, options)

method: the HTTP method you want to use all lowercase ('put', 'post', or 'get')

url: the back end route you want to hit

options: an object of different options which are defined below

body: object (data to be sent in AJAX, required for post and put requests)

success: function (optional front end successCallback console logs succes message by default)

error: function (optional front end errorCallback console logs error message by default)

shouldStoreReceive: boolean (if the backend data should end up in a store)

storeActionType: the name of the store action that received data (required if shouldReceive is true)

example

```javascript
var signUpBody = {

username: this.state.username,

password: this.state.password,

email: this.state.email,

};

FastFlux.webCycle('post', '/signup', {

body: signUpBody,

});
```