Exemplo n.º 1
0
        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);
            })));
        }
Exemplo n.º 2
0
 public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Action <T> fn)
 {
     return(factory.Canonical <T>(fn.ReturnPromise(factory)));
 }
Exemplo n.º 3
0
 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)));
 }
Exemplo n.º 4
0
 public static Func <T, IPromise <ControlValue <object> > > Canonical <T>(this PromiseFactory factory, Func <T, ControlState> fn)
 {
     return(factory.Canonical <T, object>(x => factory.Value(fn(x))));
 }
Exemplo n.º 5
0
 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))));
 }
Exemplo n.º 6
0
 public static Func <T, IPromise <ControlValue <E> > > Canonical <T, E>(this PromiseFactory factory, Func <T, E> fn)
 {
     return(factory.Canonical <T, E>(x => factory.Value(fn(x))));
 }
Exemplo n.º 7
0
 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))));
 }
Exemplo n.º 8
0
 public static Func <IPromise <ControlValue <object> > > Canonical(this PromiseFactory factory, Action fn)
 {
     return(factory.Canonical <object>(fn));
 }
Exemplo n.º 9
0
 public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <ControlState> fn)
 {
     return(factory.Canonical <T>(() => factory.Value(fn())));
 }
Exemplo n.º 10
0
 public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <IPromise> fn)
 {
     return(factory.Canonical <T>(() => factory.SafeThen(fn, () => ControlState.Next)));
 }
Exemplo n.º 11
0
 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))));
 }
Exemplo n.º 12
0
 public static Func <IPromise <ControlValue <T> > > Canonical <T>(this PromiseFactory factory, Func <NullableResult <T> > fn)
 {
     return(factory.Canonical(() => factory.Value(fn())));
 }
Exemplo n.º 13
0
 public Scope <T> Run(Func <ControlValue <T> > action)
 {
     return(Run(_factory.Canonical(action)));
 }
Exemplo n.º 14
0
 public IPromise <ControlValue <T> > Do <T>(Func <ControlValue <T> > body)
 {
     return(Do(_factory.Canonical(body)));
 }
Exemplo n.º 15
0
 public For <T> Iterate(Func <T, ControlValue <T> > iterator)
 {
     return(Iterate(_factory.Canonical(iterator)));
 }