Updated Web application (markdown)

master
Simon Rozsival 8 years ago
parent 2bb140fb94
commit 69868b13e8

@ -28,7 +28,8 @@ The whole project is written using the next generation of JavaScript referred to
The redux [store](https://github.com/ReCodEx/web-app/blob/master/src/redux/store.js) is extended with several middlewares - [redux-thunk](https://github.com/gaearon/redux-thunk), [redux-promise-middleware](https://github.com/pburtchaell/redux-promise-middleware), router middleware, accessTokenMiddleware, and apiMiddleware.
#### apiMiddleware
- @todo: apiMiddleware
The API middleware catches all the `'CALL_API'` actions and turns them into a HTTP request via the [fetch API](https://developer.mozilla.org/en/docs/Web/API/Fetch_API). The middleware deeply converts data in the *body* part of the request to `FormData` and sets correctly the headers and creates endpoints for the API server before each request is sent. The middleware also handle the responses - converts them to the format expected by the reducers and catches requests' failures.
#### accessTokenMiddleware

Loading…
Cancel
Save