Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public TrackedItem(Deferred deferred, Func <bool> condition)
 {
     Deferred  = deferred;
     Condition = condition;
 }