public IPromise <TNext> Then <TNext>(Func <IPromise <TNext> > next) { var deferred = new Deferred <TNext>(); AssignDisposer(deferred, Disposer); Done(() => { var promise = next(); AssignDisposer((BaseDeferred)promise, Disposer); promise.Done(res => deferred.Resolve(res)); promise.Fail(() => deferred.Reject()); }); Fail(() => deferred.Reject()); return(deferred); }
public TrackedItem(Deferred deferred, Func <bool> condition) { Deferred = deferred; Condition = condition; }