Skip to content

Latest commit

 

History

History
18 lines (17 loc) · 440 Bytes

README.md

File metadata and controls

18 lines (17 loc) · 440 Bytes

ReactNative-Redux-Axios

export const httpGet = (config) => {
  return (dispatch) => {
    myDispatcher(dispatch, SHOW_LOADING, true);
    axios({
      method: 'get',
      url: apiUrl + config.method,
      params: config.params
    }).then(res => {
      myDispatcher(dispatch, HTTP_SUCCESS, { response: res.data, state: config.state });
    }).catch(err => {
      myDispatcher(dispatch, HTTP_ERROR, err);
    });
  };
};