title: How can I make a Switch component async await for successful response before changing value?
body: <p>The default flow of a switch will toggle the value as soon as it is pressed.</p>
  
  <p>I want to execute the following logic</p>
  
  <ol>
  <li>Press switch</li>
  <li><strong>Don't change the value yet</strong></li>
  <li>Open alert box</li>
  <li>If ok, send post request to toggle database value</li>
  <li>On successful response, allow the switch value to change</li>
  </ol>
  
  <p>I can get the successful response and update the switch, but as soon as I press the switch the value toggles twice and I want to pause this behaviour until there is a successful response. Tried async await, tried wrapping the switch in a touchablewithout feedback... now need some help</p>
  
  <pre><code>&lt;Switch 
     value={this._getSwitchValue(id)} 
     onValueChange={() =&gt; this._toggleSwitch(id)}
  /&gt;
  
    /**
     * Toggle the Switch - Send post request to database
     */
    _toggleSwitch (id) {
      Alert.alert('Notice!', 'Do you really want to change this setting?',
      [
        { text: "OK", onPress: () =&gt; this.props.toggleSettingsSwitch(id, this.props.token) },
        { text: "Cancel", onPress: () =&gt; console.log("cancel pressed")}
      ],
      { cancelable: true }
    )}
  </code></pre>