title: How to call function after fetch() has finished
body: <p>I am using react-native and I have fetch GET request which takes an array. Now I need this fetch() to finish getting that array so I can call a function which will handle this array and do something with it. How do I wait for it to finish?</p>
  <p>This is my request:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>componentWillMount() {
    console.log("will mount");
    fetch('SOME_API', {
      method: "GET",
      headers: {
        Accept: 'text/javascript',
        'Content-Type': 'text/javascript',
      }
    }).then(response = &gt;response.json()).then(responseJson = &gt;{
      this.setState(function(prevState, props) {
        return {
          questions: responseJson,
          loading: false
        }
      })
    })
  }</code></pre>
  </div>
  </div>
  </p>
  <p>And when this get request puts responseJson in state I want to call my function that will do something with that array.</p>
  <p>If you need any more info please comment.</p>