package promise_jsoo_lwt

  1. Overview
  2. Docs
Conversion functions between JS Promises and Lwt Promises

Install

dune-project
 Dependency

Authors

Maintainers

Sources

promise_jsoo-0.4.3.tbz
sha256=7c889da114dd89eeb89d9d5a50ad895a1709a35fc50f33f852efa04c96a876d2
sha512=b3ebecd4789bf40d60b9efe5117535e58af663e0a1a9b51be25ecba41f15472b76de356472b2457eeca8a9d3b6deae4cb33eaf03be596af0606b5409d12ec3b6

doc/promise_jsoo_lwt/Promise_lwt/index.html

Module Promise_lwtSource

Sourcetype +'a t = 'a Lwt.t
Sourceexception Promise_error of Promise.error

Promise_error is used to wrap JS promise errors in order to reject a Lwt promise

Sourceval of_promise : 'a Promise.t -> 'a t

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.

Sourceval to_promise : 'a t -> 'a Promise.t

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.

Compatibility with gen_js_api

Sourceval t_to_js : ('a -> Ojs.t) -> 'a t -> Ojs.t
Sourceval t_of_js : (Ojs.t -> 'a) -> Ojs.t -> 'a t