title: How can I get the response from dispatch?
body: <p>I have a component which has a form where at the moment to do clic on submit button, I call a function <code>handleSubmit</code> (it is on my component), this function call an action through of <code>dispatch</code> and this action, I make a call to a service (HTTP Request).</p>
  
  <p><strong>handleSubmit</strong></p>
  
  <pre><code>handleSubmit = (e) =&gt; {
     e.preventDefault()
     const { validateFields } = this.props.form;
  
     validateFields((err, params) =&gt; {
         if (!err) {
              const { user, dispatch } = this.props;
  
              let response = dispatch(actions.addDevice(params))
              console.log(response); //Response is undefined
         }
      });
  }
  </code></pre>
  
  <p><strong>actions.addDevice</strong></p>
  
  <pre><code>function addDevice(params){
      return (dispatch, getState) =&gt; {
          let { authentication } = getState();
          dispatch(request({}));
  
          service.addDevice(params, authentication.user.access_token)
              .then(
                  response =&gt; {
                      if(response.status === 201) {
                          dispatch(success(response.data));
                      }
                      return response;
                  },
                  error =&gt; {
                      dispatch(failure(error.toString()));
                      dispatch(alertActions.error(error.toString()));
                  }
              )
      }
  
      function request(response) { return { type: constants.ADD_DEVICE_REQUEST, response } }
      function success(response) { return { type: constants.ADD_DEVICE_SUCCESS, response } }
      function failure(error) { return { type: constants.ADD_DEVICE_FAILURE, error } }
  }
  </code></pre>
  
  <p><strong>service.addDevice</strong></p>
  
  <pre><code>function addDevice(params, token){
      return axios({
          url: 'http://localhost:5000/user/add-device',
          method: 'POST',
          headers: { 'Authorization': 'Bearer ' + token},
          data: {
              data1: params.data1,
              data2: params.data2,
              data3: params.data3
          }
      })
      .then(function(response) {
          return response;
      })
      .catch(function(error) {
          return error.response;
      });
  }
  </code></pre>
  
  <p>I would like to get the response in my component to be able to make validations but as the request is async, I never can get the response and only prints an undefined variable. How can I get the response sync? Or what do I need do to be able to make validations?</p>