Factory methods for Promise creation#104
Factory methods for Promise creation#104njannink wants to merge 2 commits intoReal-Serious-Games:masterfrom
Conversation
|
Looks good although could do with some unit tests and I'm not entirely sure if I understand the use-case for this. In the example you gave with a cast to an IPromise, the cast doesn't appear to do anything. It shouldn't matter in that case whether it's an IPromise or Promise because the chain of |
|
The problem is with IPromiseOfT. If you want to convert that one to a Promise that doesn't do anything you run into problems at this moment if you want to convert that one in a Promise with no result. You then get a I will add some tests |
I added some factory methods to create the Promises. This prevents the need of casts in some Then(...) constructions:
old
.Then(() => (IPromise) new Promise((resolve, reject) => ....))new
.Then(() => Promise.Create((resolve, reject) => ....))