title: Resolve Promise After Executing Single Line Of Code
body: <p>I have a sequence of events I'm trying to align, but I don't understand how to resolve a promise after a single line of asynchronous code. In this case, I'm making an API call which resolves to an array of objects. I'm then using Object.assign() to convert the array of objects into an object of objects. Once completed, I then want to call a function which does something with that new object of objects. The conversion process takes some time, and I'm not sure how to postpone my function call until after the object has been converted. My non-functioning code is given below.</p>
  
  <pre><code>this.queryCodes().then(() =&gt; {
    new Promise((resolve) =&gt; {
      resolve(() =&gt; {
        // This code isn't executing.
        this.floorCodesLookup = Object.assign({}, ...this.floorCodes);
      });
    }).then((data) =&gt; {
      this.resolveCodesToDescriptions();
    });
  });
  </code></pre>