js_of_ocaml
js_of_ocaml copied to clipboard
[FEATURE REQUEST] Integrate a Promise API
The folks at Funkyworker have an API that nicely sidesteps the type unsafety of the JS Promise API: https://github.com/funkywork/nightmare/blob/main/lib/js/promise.mli (see also https://github.com/funkywork/nightmare/blob/main/lib/js/stubs/caml_promise_stubs.js)
Should we consider including it in Js_of_ocaml? I hear that they would be fine with this copyright-wise.
Having a Promise API would also unlock #596.
PR would be welcome. It was attempted before but needed more work.
What was the previous attempt?
Having a Promise API would also unlock #596.
If that's your motivation note that this has been bound for ages in brr.
Having a Promise API would also unlock #596.
If that's your motivation note that this has been bound for ages in brr.
Yes, and that's one of the inspirations for the stubs (Brr being mentioned). However, I think that, as a JSOO user, it's a feature I'd like to have directly, without having to depend on another library.
We've been using https://github.com/mnxn/promise_jsoo for a few years now, and it's worked pretty well for us