title: Resolve recursive (n → ∞) Promise(s)
body: <p>Consider the following recursive parent/child tree-builder pseudo/example. Figuring out what is the best approach to determine when recursion stops so I can resolve the whole of it.
  I was thinking in the direction of async/await (running it in a separate thread) &gt; by default set the recursion to loading and when it passes await, i can trigger further functionality.</p>
  <p>Maybe something like RxJS offers more tooling for these things?</p>
  <pre><code>    const getEntries = () =&gt; {
          entries.forEach(entry =&gt; {
              getRecursiveEntry(entry.id).then((result)=&gt;{
                  console.log('resolved', result);
                  // trigger some next functionality
              });
          });
      }
  
      const getRecursiveEntry = (entryId) =&gt; {
          new Promise&lt;void&gt;(resolve =&gt; {
              externalAPI.getEntry(entryId).then((childEntryData) =&gt; {
                  // builds parent/child hierarchy
                  buildDataTree(childEntryData);
                  if(childEntryData.childId) {
                      getRecursiveEntry(childEntryData.childId);
                  }
                  // do something with resolve,.. resolve();
              });
          });
      }
  </code></pre>