/// <summary> /// Chain an enumerable of promises, all of which must resolve. /// Converts to a non-value promise. /// The resulting promise is resolved when all of the promises have resolved. /// It is rejected as soon as any of the promises have been rejected. /// </summary> public IPromise <IEnumerable <ConvertedT> > ThenAll <ConvertedT>(Func <IEnumerable <IPromise <ConvertedT> > > chain) { return(Then(() => Promise <ConvertedT> .All(chain()))); }
/// <summary> /// Chain an enumerable of promises, all of which must resolve. /// Converts to a non-value promise. /// The resulting promise is resolved when all of the promises have resolved. /// It is rejected as soon as any of the promises have been rejected. /// </summary> public IPromise ThenAll(Func <PromisedT, IEnumerable <IPromise> > chain) { return(Then(value => Promise.All(chain(value)))); }
/// <summary> /// Chain an enumerable of promises, all of which must resolve. /// The resulting promise is resolved when all of the promises have resolved. /// It is rejected as soon as any of the promises have been rejected. /// </summary> public IPromise ThenAll(Func <IEnumerable <IPromise> > chain) { return(Then(() => Promise.All(chain()))); }
/// <summary> /// Chain an enumerable of promises, all of which must resolve. /// Returns a promise for a collection of the resolved results. /// The resulting promise is resolved when all of the promises have resolved. /// It is rejected as soon as any of the promises have been rejected. /// </summary> public IPromise <IEnumerable <ConvertedT> > ThenAll <ConvertedT>(Func <PromisedT, IEnumerable <IPromise <ConvertedT> > > chain) { return(Then(value => Promise <ConvertedT> .All(chain(value)))); }