January 2020
Intermediate to advanced
428 pages
10h 34m
English
Axios (https://github.com/axios/axios) is a Promise-based HTTP client. It is a powerful and flexible library with a very straightforward API. It is used to fetch data from the JHipster application's server-side REST endpoints from Redux actions. The resulting Promise is resolved by the Redux Promise Middleware to provide data to the reducer.
The following code shows a Redux action with an asynchronous payload:
export const getEnv = () => ({ type: ACTION_TYPES.FETCH_ENV, payload: axios.get('management/env')});
Axios is used to fetch the payload and return the promise that will be resolved by our Redux middleware.
Read now
Unlock full access