title: Make two actions work simultaneously - react native and redux
body: <p>I've a button that sends two actions. First one adds the user infos in an array if certain condition is met and 2nd one sends the data to the server.
  Since both actions are in onPress function, the 2nd action doesn't wait till it adds up the infos in an array. Henceforth, it always sends empty array.
  How can I make this two actions work simultaneously.</p>
  
  <pre><code>&lt;TouchableOpacity
      onPress={() =&gt; {
        if (true) {
          this.props.AuthUserInfoGet(SignUpName, SignUpDesignation, SignUpEmail, SignUpMobileNo); //calculates &amp; return SignUpUsers
        }
        this.props.SignUpCheck(SignUpUsers); //upload SignUpUsers but SignUpCheck is always empty here
      }}
  &gt;
        &lt;Text&gt;Upload&lt;/Text&gt;
  &lt;/TouchableOpacity&gt;
  
  const mapStateToProps = (state) =&gt; {
    const {SignUpUsers} = state.Auth;
    //it gives an empty array first and then expected value
    console.log('SignUpUsersz', SignUpUsers);
  
    return {SignUpUsers};
  };
  </code></pre>
  
  <p>Action:</p>
  
  <pre><code>export const AuthUserInfoGet = (SignUpName, SignUpDesignation, SignUpEmail, SignUpMobileNo) =&gt; {
    return ({
      type: SIGN_UP_USER_INFO_GET,
      payloadName: SignUpName,
      payloadDesignation: SignUpDesignation,
      payloadEmail: SignUpEmail,
      payloadMobile: SignUpMobileNo,
    });
  }
  
  export const SignUpCheck = (userInfo) =&gt; {
      console.log('userInfo', userInfo); // userInfo is always empty
  }
  </code></pre>
  
  <p>Reducer:</p>
  
  <pre><code>const INITIAL_STATE = { SignUpUsers: [] }
  
  case SIGN_UP_USER_INFO_GET:
    return { ...state, SignUpUsers: [...state.SignUpUsers, {member_name: actions.payloadName, designation: actions.payloadDesignation,
      email: actions.payloadEmail, mobile_number: actions.payloadMobile}] };
  </code></pre>