title: Should I store promises in Redux?
body: <p>I'm using Redux and React in an online food-ordering app.</p>
  
  <p>When the user removes an item from their basket, I need to fire off an XHR request to the server to compute the new total price for the basket. When this XHR completes, I update the redux store and render the new price. I'm using Redux thunk to manage this async operation.</p>
  
  <p>There is a problem is a user removes two items from the basket in quick succession. The user removes the first item, and I fire off an XHR to get the new price. Then the user clicks a button to remove a second item, and a second XHR is fired off.</p>
  
  <p>The UI will be in an incorrect state if the second XHR completes before the first - the price of the basket with only the first item removed will be shown.</p>
  
  <p>To work around this, I want to cancel the first (in-flight) XHR when the user clicks the button to remove the second item. To cancel the first XHR I need to keep track of the promise object (I'm using <a href="https://github.com/mzabriskie/axios" rel="noreferrer">axios</a> to manage XHR).</p>
  
  <p>It makes sense to me to store the in-flight XHR in the redux store. Is it bad practice to store promises in Redux like this? It seems to be frowned upon - Redux should really just be storing plain data.</p>