Пример #1
0
 public Promise Then(Action action)
 {
     onResolve.AddListenerOneShot(action);
     if (isResolved)
     {
         onResolve.Invoke();
     }
     return(this);
 }
Пример #2
0
 public Promise Catch(Action <Exception> action)
 {
     onReject.AddListenerOneShot(action);
     if (isRejected)
     {
         onReject.Invoke(cachedException);
     }
     return(this);
 }
Пример #3
0
 public Promise <T> Then(Action <T> action)
 {
     onResolve.AddListenerOneShot(action);
     if (isResolved)
     {
         onResolve.Invoke(cache);
     }
     return(this);
 }