Brian Mckenna criticised current spec. He proposes to use FP approach to achieve much better modularity.
Suggest to read it, really good ideas with just three changes.
http://brianmckenna.org/blog/category_theory_promisesaplus
His proposal is to incorporate into spec three simple apis:
Promise.of(a) will turn anything into promise.
Promise#then(f) should take one function, not two.
Promise#onRejected(f): move onRejected to prototype instead of second arg.
edit: see promises-aplus/constructor-spec#24 for more discussion
Brian Mckenna criticised current spec. He proposes to use FP approach to achieve much better modularity.
Suggest to read it, really good ideas with just three changes.
http://brianmckenna.org/blog/category_theory_promisesaplus
His proposal is to incorporate into spec three simple apis:
Promise.of(a)will turn anything into promise.Promise#then(f)should take one function, not two.Promise#onRejected(f): moveonRejectedto prototype instead of second arg.edit: see promises-aplus/constructor-spec#24 for more discussion