public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, IPromise <NullableResult <E> > > fn) { return(factory.Canonical <T, E>(x => factory.SafeThen(fn(x), result => { if (result == null || !result.HasResult) { return ControlValue <E> .Next; } return ControlValue <E> .Return(result.Result); }))); }
public static IPromise <E> SafeThen <T, E>(this PromiseFactory factory, IPromise <T> next, Func <T, E> conusmer) { return(factory.SafeThen(next, x => factory.Value(conusmer(x)))); }
public static IPromise <E> SafeThen <T, E>(this PromiseFactory factory, IPromise <T> next, Func <IPromise <E> > consumer) { return(factory.SafeThen(next, x => consumer())); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, IPromise> fn) { return(factory.Canonical <T, object>(x => factory.SafeThen(fn(x), () => ControlValue <object> .Next))); }
public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, IPromise <ControlState> > fn) { return(factory.Canonical <T, object>(x => factory.SafeThen(fn(x), result => new ControlValue <object>(result)))); }
public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, IPromise <E> > fn) { return(factory.Canonical <T, E>(x => factory.SafeThen(fn(x), result => ControlValue <E> .Return(result)))); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <IPromise> fn) { return(factory.Canonical <T>(() => factory.SafeThen(fn, () => ControlState.Next))); }
public static IPromise SafeThen(this PromiseFactory factory, Func <IPromise> next, Action consumer) { return(factory.SafeThen(next(), consumer)); }
public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <IPromise <ControlState> > fn) { return(factory.Canonical(() => factory.SafeThen(fn, result => new ControlValue <T>(result)))); }
public static IPromise SafeThen(this PromiseFactory factory, IPromise next, Action consumer) { return(factory.SafeThen(next, consumer.ReturnPromise(factory))); }
public static IPromise <T> SafeThen <T>(this PromiseFactory factory, Func <IPromise> next, Func <T> consumer) { return(factory.SafeThen(next(), consumer)); }
public static IPromise SafeThen(this PromiseFactory factory, IPromise next, Func <IPromise> consumer) { return(factory.SafeThen(next, () => consumer().UnCast(factory)).Cast()); }
public static IPromise <T> SafeThen <T>(this PromiseFactory factory, IPromise next, Func <T> conusmer) { return(factory.SafeThen(next, () => factory.Value(conusmer()))); }
public static IPromise <T> SafeThen <T>(this PromiseFactory factory, IPromise next, Func <IPromise <T> > consumer) { return(factory.SafeThen(next.UnCast(factory), consumer)); }
public static IPromise SafeThen <T>(this PromiseFactory factory, IPromise <T> next, Action consumer) { return(factory.SafeThen(next, x => consumer())); }
public static IPromise SafeThen <T>(this PromiseFactory factory, IPromise <T> next, Func <T, IPromise> consumer) { return(factory.SafeThen(next, x => consumer(x).UnCast(factory)).Cast()); }