public static IPromise <IPromiseEnumerator <T> > Reverse <T>(IPromiseEnumerator <T> items) { return(items.MoveNext().Then(result => { if (result == null) { return null; } return PromiseEnumerator.Create(items.Factory, new T[] { result.Current }).Then(right => { return Reverse(result).Then(left => { return (IPromiseEnumerator <T>)(ConcatEnumerator.Create(left, right)); }); }); })); }
public static IPromiseEnumerator <T> Union <T>(IPromiseEnumerator <T> left, IPromiseEnumerator <T> right, IEqualityComparer <T> comparer) { return(DistinctEnumerator.Create(ConcatEnumerator.Create(left, right), comparer)); }
public static IPromiseEnumerator <T> Union <T>(IPromiseEnumerator <T> left, IPromiseEnumerator <T> right) { return(DistinctEnumerator.Create(ConcatEnumerator.Create(left, right))); }