- Add the
thenResolvefunction, which is essentially themapfunction we removed in v1, but with a better name (thanks @mrmurphy for the suggestion)
Breaking
catchwas not aligned withthenand didn't return at<'a>. This change forces users to resolve a value within acatchcallback.
Promise.resolve(1)
- ->catch(err => {
- ()
- })
+ ->catch(err => {
+ resolve()
+ })Note: This also aligns with the previous Js.Promise.catch_.
Breaking
- Removed
mapfunction to stay closer to JS api. To migrate, replace allmapcalls withthen, and make sure you return aJs.Promise.tvalue in thethenbody, e.g.
Promise.resolve(1)
- ->map(n => {
- n + 1
- })
+ ->then(n => {
+ resolve(n + 1)
+ })Bug fixes
- Fixes an issue where
Promise.all*are mapping to the wrong parameter list (should have been tuples, not variadic args)
- Initial release