- Add the
thenResolve
function, which is essentially themap
function we removed in v1, but with a better name (thanks @mrmurphy for the suggestion)
Breaking
catch
was not aligned withthen
and didn't return at<'a>
. This change forces users to resolve a value within acatch
callback.
Promise.resolve(1)
- ->catch(err => {
- ()
- })
+ ->catch(err => {
+ resolve()
+ })
Note: This also aligns with the previous Js.Promise.catch_
.
Breaking
- Removed
map
function to stay closer to JS api. To migrate, replace allmap
calls withthen
, and make sure you return aJs.Promise.t
value in thethen
body, 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