title: How do I use Promise.all() with chrome.storage()?
body: <p>I have several async functions running. I want to wait for them all to finish before taking the next steps. Here's my code that I'm using to get all of the key/values from <code>chrome.storage</code> and the <code>Promise.all()</code> implementation.</p>
  
  <pre><code>var promise1 = Promise.resolve(3);
  var promise2 = 42;
  var promise3 = new Promise(function(resolve, reject) {
    setTimeout(resolve, 100, 'foo');
  });
  
  var getAll = chrome.storage.sync.get(function(result) {
    console.log(result)
  });
  
  Promise.all([promise1, promise2, promise3, getAll]).then(function(values) {
    console.log(values); // [3, 42, "foo", undefined]
  });
  </code></pre>
  
  <p>This doesn't work unfortunately. It returns <code>undefined</code>.</p>
  
  <p>Most of the code above is taken from MDN here: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all" rel="noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all</a></p>