I've recently written a promises library in ruby. It implements the Promises/A+ spec almost exactly, with one difference - A promise callback must return a promise.
This gives them some nice properties, particularly thenables can be wrapped in promises. With the current Promises/A+ spec, trying to use an object that happens to implement a then method as a value for a promise will essentially break a promise chain, causing potentially hard to debug problems.
It draws partially from Promise.rb (https://github.com/lgierth/promise.rb), being agnostic about which reactor library you use.
Here is the github link: https://github.com/c...in/pure_promise.
I'd love feedback
PurePromise - Promises/A+ with a twist
Posted 17 August 2014 - 11:35 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users