Promise_lwt
exception Promise_error of Promise.error
Promise_error
is used to wrap JS promise errors in order to reject a Lwt promise
of_promise
converts from a JS promise to a Lwt promise
If a JS promise is rejected with e
, the error value is wrapped and the Lwt promise is reject with Promise_error e
.
to_promise
converts from a Lwt promise to a JS promise
If a Lwt promise is rejected with Promise_error e
, the error value is unwrapped and the JS promise is rejected with e
.
val t_to_js : ('a -> Ojs.t) -> 'a t -> Ojs.t
val t_of_js : (Ojs.t -> 'a) -> Ojs.t -> 'a t