Third-party: rescript-future

Hi :wave:

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!

17 Likes

I just tried it in replacement for reason-future, works like a charm!
Future.make becomes Future.makePure (since make is cancellable), that the only change with reason-future I noticed.
Thanks for your work!

1 Like

Thanks for your work! This looks great, keeping things lean and supporting cancellation, too. :+1:

Just opened a first PR. :slight_smile:

1 Like