package promise_jsoo_lwt

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

Install

Dune Dependency

Authors

Maintainers

Sources

promise_jsoo-0.4.2.tbz
sha256=b262ff66d685cc86d309ac85847b2b399f0c3e99f9b9b06bd6b38b86036dc27c
sha512=dec192b51ad1189bec59c053de3aeca7fb8d6ba4195ed9617d753a202f3b50383f3c059d280833a39c1b3561a61e88d930293219010b2c2e0c102c0e59a8f4e8

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
OCaml

Innovation. Community. Security.