Hi
I’ve created a Future
library for ReScript. Its API is approximately the same as https://github.com/RationalJS/future (which is the original inspiration).
It handles cancellation and propagation of cancellation down to the futures that were created through map
and flatMap
, with cancellation effects (so that you can for instance abort a XMLHttpRequest
when you receive the cancellation signal).
It’s also focused on debuggability, with a runtime representation that’s easily readable ({TAG: "Pending", …}
, {TAG: "Cancelled", …}
, {TAG: "Resolved", VAL: value}
).
Hope it can be useful!