Jv.PromiseJavaScript promise support.
In bindings do not use this directly use Fut.
type t = jvThe type for JavaScript promises.
val create : (('a -> unit) -> ('b -> unit) -> unit) -> tcreate (fun res rej -> ...) is a promise that can be resolved with res and rejected with rej. Note that res has a weird semantics see resolve for details.
val resolve : 'a -> tresolve v is a promise that resolve with v. Warning. this is not a monadic return it also joins. Use Fut for a sound typed semantics of promises.
val reject : 'a -> treject v is a promise that rejects with v.
val await : t -> ('a -> unit) -> unitawait p k waits for p to resolve and continues with k.
then' p res rej binds p's resolution to res and p's rejection to rej.