title: Can I resolve a Promise from the outside?
body: <p>Using ES2015, can I resolve a promise <em>from the outside</em> i.e. trigger a resolution after its creation?</p>
  
  <p>Like</p>
  
  <pre><code>const promise = new Promise();
  promise.then(() =&gt; foo());
  promise.resolve(); // foo() gets executed
  </code></pre>