Skip to content

Instantly share code, notes, and snippets.

@hew
Last active Jun 5, 2019
Embed
What would you like to do?
Reasonml Await

Reasonml await

module Await = {
let let_ = (promise, continuation) =>
promise
>>= (v => Belt.Result.Ok(v) |> continuation |> return)
>>| (
v =>
{
Js.log(v);
Belt.Result.Error(v |> Js.String.make);
}
|> continuation
|> return
)
|> ignore;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment