Repromise is a binding to JS promises, now in NPM! It is an alternative to Js.Promise
that ensures type safety while preserving interop. The full docs are here.
Basically, what Repromise does is:
- reuse the existing promise objects from JS,
-
replace JS promise functions (
resolve
, etc.) with new, type-safe versions.
That means all JS libraries that return promises already work with Repromise, and we can take advantage of existing promise tooling in the JS community.
Besides that, Repromise also has:
- a native implementation, which is a bunch of pure-Reason code that implements Repromise’s improved JS promises on native, and
- prototype
async
/await
syntax.
These are still unreleased. In the coming weeks, we will integrate native Repromise with Lwt, and, eventually, with libuv.
Ultimately, we would like to upstream Repromise into BuckleScript. We are releasing Repromise standalone first, because that way it will develop faster So please try it out, join us in the bikeshedding issue, give your opinion on error handling, and help make JS promises pleasant to use