title: How to get data from axios request?
body: <p>I'm having a problem with an axios GET request in my alpine component.
  It always returns a Promise instead of the actual data.</p>
  <p>The GET request sends an array of id's <em>(which is stores in localstorage)</em> to an API endpoint, where more data is loaded from the database for each of the id's. When testing this is Postman, it's working perfectly.
  The problem happens when I'm trying to iterate the results with <code>x-for</code>. It fails because the request do not contain the actual data, but a <em>&quot;Promise &lt; pending &gt;&quot;</em>.</p>
  <p>I've tried to call an aditional <code>.then</code> on my <code>getItems()</code> function but that still only returns the Promise instead of the data. I've also tried to use <code>async</code> and <code>await</code> but that doesn't work either.</p>
  <p>Heres my full code:</p>
  <p><strong>JS:</strong></p>
  <pre class="lang-js prettyprint-override"><code>import axios from 'axios'
  window.Spruce.store('my_store', {
    items: [],
  }, true)
  window.myComponent = function() {
    return {
      itemIds() {
        return this.$store['my_store'].items
      },
      getItems() {
        return axios.get('http://my-application.test/wp-json/my-api/images/?ids=' + this.itemIds()).then((response) =&gt; {
          return response.data
        }).catch((error) =&gt; {
          console.log(error)
        })
      },
    }
  }
  </code></pre>
  <p><strong>async await attempt</strong></p>
  <pre class="lang-js prettyprint-override"><code>async getItems() {
    return await axios.get('http://my-application.test/wp-json/my-api/images/?ids=' + this.itemIds()).then((response) =&gt; {
      return response.data
    }).catch((error) =&gt; {
      console.log(error)
    })
  },
  </code></pre>
  <p><strong>HTML:</strong></p>
  <pre class="lang-html prettyprint-override"><code>&lt;div x-data=&quot;myComponent()&quot;&gt;
      &lt;template x-for=&quot;item in getItems()&quot;&gt;
          &lt;div x-text=&quot;item.title&quot;&gt;&lt;/div&gt;
      &lt;/template&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Anyone know how I'm going to make <code>getItems()</code> return the actual data so I can use it in my <code>x-for</code> loop, in the HTML?</p>