Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions rpclib-js.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ depends: [
"ocaml"
"dune" {>= "1.1.0"}
"rpclib" {>= "5.0.0"}
"js_of_ocaml" {>= "3.3.0"}
"js_of_ocaml-ppx" {>= "3.3.0"}
"js_of_ocaml" {>= "3.5.0"}
"js_of_ocaml-ppx" {>= "3.5.0"}
"lwt"
]
build: ["dune" "build" "-p" name "-j" jobs]
Expand Down
6 changes: 5 additions & 1 deletion src/js/rpc_client_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ let do_rpc enc dec content_type ~url call =
Js_of_ocaml.Js.wrap_callback (fun _ ->
match req ##. readyState with
| Js_of_ocaml.XmlHttpRequest.DONE ->
Lwt.wakeup w (dec (Js_of_ocaml.Js.to_string req ##. responseText))
Lwt.wakeup w (dec
(Js_of_ocaml.Js.Opt.case
req##.responseText
(fun () -> "")
(fun x -> Js_of_ocaml.Js.to_string x)))
| _ -> () ) ;
req ## send (Js_of_ocaml.Js.some (Js_of_ocaml.Js.string contents)) ;
Lwt.on_cancel res (fun () -> req ## abort) ;
Expand Down