static thenAll(iterable) {
      // Turn rejected promises into resolved ones
      $$(iterable).forEach(promise => {
        if ($.type(promise) == "promise") {
          promise = promise.catch(err => err);
        }
      });
      return Promise.all(iterable).then(resolved => {
        if (iterable.length != resolved.length) {
          // The list of promises or values changed. Return a new Promise.
          // The original promise won't resolve until the new one does.
          return _.thenAll(iterable);
        } // The list of promises or values stayed the same.
        // Return results immediately.


        return resolved;
      });
    }
Similar to Promise.all() but can handle post-hoc additions
and does not reject if one promise rejects.