##// END OF EJS Templates
Fixed chaining of promises with 'Then' method
cin -
r135:656815cb7147 v2
parent child
Show More
@@ -349,18 +349,24 namespace Implab {
349 349
350 350 public IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception, T2> error, Func<T2> cancel) {
351 351 var promise = new Promise<T2>();
352 if (mapper != null)
353 promise.On(Cancel, PromiseEventType.Cancelled);
352 354 AddHandler(new RemapDescriptor<T2>(mapper, error, cancel, promise));
353 355 return promise;
354 356 }
355 357
356 358 public IPromise<T2> Then<T2>(Func<T, T2> mapper, Func<Exception, T2> error) {
357 359 var promise = new Promise<T2>();
360 if (mapper != null)
361 promise.On(Cancel, PromiseEventType.Cancelled);
358 362 AddHandler(new RemapDescriptor<T2>(mapper, error, null, promise));
359 363 return promise;
360 364 }
361 365
362 366 public IPromise<T2> Then<T2>(Func<T, T2> mapper) {
363 367 var promise = new Promise<T2>();
368 if (mapper != null)
369 promise.On(Cancel, PromiseEventType.Cancelled);
364 370 AddHandler(new RemapDescriptor<T2>(mapper, null, null, promise));
365 371 return promise;
366 372 }
General Comments 0
You need to be logged in to leave comments. Login now