title: Using Promises with React Redux
body: <p>I'm trying to set my Redux state with some items that depend on an API call.</p>
  
  <p>This is what i have so far.</p>
  
  <p>The Api call -> </p>
  
  <pre><code>return new Promise((resolve, reject) =&gt; {
      const _items = [];
      axios.get(SiteUrl + spQuery).then((response) =&gt; {
         //console.log(response);
          return response.data.d.results;
      }).then((listItemsData) =&gt; {
          ......
          _items.push({...});
          return _items;
      }).then((items) =&gt; { 
          resolve(items);
      });
  });
  </code></pre>
  
  <p>And in my componentDidMount() i tried several things, including -> </p>
  
  <pre><code>store.dispatch(addListItem(this.updateSharepointList().then((result) =&gt; { return result })));
  </code></pre>
  
  <p>And</p>
  
  <pre><code>    store.dispatch(addListItem(this.updateSharepointList()));
  </code></pre>
  
  <p>Both of the calls return the Promise object (with <code>PromiseValue</code>) but if i do it like <code>//let test = this.updateSharepointList().then((result) =&gt; { console.log(result) });
  </code></p>
  
  <p>And i use <code>console.log(test)</code> it is fine. I get back the array of items.</p>
  
  <p>What am i doing wrong here? </p>