package server-reason-react
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Rendering React components on the server natively
Install
dune-project
Dependency
Authors
Maintainers
Sources
server-reason-react-0.4.1.tbz
sha256=2d27cb4656208dde8d5eb0c452c590186d092618ac0a04f1ab0a095a3ca58498
sha512=26e16daf87f6b80eff86ccf7df29153527b24e3f4dbc7f13820d1507b0a2e7d6db40fd774bcaad6e6cccff0bf19d4a411b95a10a071f9ce92d52bf07eb08f75f
doc/src/server-reason-react.js/Js_promise.ml.html
Source file Js_promise.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52type +'a t = 'a Lwt.t type error = exn let make (fn : resolve:('a -> unit) -> reject:(exn -> unit) -> unit) : 'a t = let promise, resolver = Lwt.task () in let resolve value = Lwt.wakeup_later resolver value in let reject exn = Lwt.wakeup_later_exn resolver exn in fn ~resolve ~reject; promise let resolve = Lwt.return let reject = Lwt.fail let all (promises : 'a t array) : 'a array t = Lwt.map Stdlib.Array.of_list (Lwt.all (Stdlib.Array.to_list promises)) let all2 (a, b) = let%lwt res_a = a in let%lwt res_b = b in Lwt.return (res_a, res_b) let all3 (a, b, c) = let%lwt res_a = a in let%lwt res_b = b in let%lwt res_c = c in Lwt.return (res_a, res_b, res_c) let all4 (a, b, c, d) = let%lwt res_a = a in let%lwt res_b = b in let%lwt res_c = c in let%lwt res_d = d in Lwt.return (res_a, res_b, res_c, res_d) let all5 (a, b, c, d, e) = let%lwt res_a = a in let%lwt res_b = b in let%lwt res_c = c in let%lwt res_d = d in let%lwt res_e = e in Lwt.return (res_a, res_b, res_c, res_d, res_e) let all6 (a, b, c, d, e, f) = let%lwt res_a = a in let%lwt res_b = b in let%lwt res_c = c in let%lwt res_d = d in let%lwt res_e = e in let%lwt res_f = f in Lwt.return (res_a, res_b, res_c, res_d, res_e, res_f) let race (promises : 'a t array) : 'a t = Lwt.pick (Stdlib.Array.to_list promises) let then_ p fn = Lwt.bind fn p let catch (handler : exn -> 'a t) (promise : 'a t) : 'a t = Lwt.catch (fun () -> promise) handler
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>