Skip to content

basarburak/ReactNative-Redux-Axios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
    });
  };
};