public IPromise ThenWaitUntil(YieldInstruction yieldInstruction) { var p = Create(); if (CurrentState == EPromiseState.Resolved) { CoroutineExtensions.WaitUntil(yieldInstruction).ThenResolvePromise(p, PromisedObject); } else { _resolutions.Add(WaitUntilResolution.Create(yieldInstruction, p)); } return(p); }
public IPromise ThenWaitUntil(Func <bool> evaluator) { var p = Create(); if (CurrentState == EPromiseState.Resolved) { CoroutineExtensions.WaitUntil(evaluator).ThenResolvePromise(p, PromisedObject); } else { _resolutions.Add(WaitUntilResolution.Create(evaluator, p)); } return(p); }