Skip to content

Commit

Permalink
Lib: fix lwt_jsonp
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Dec 19, 2022
1 parent 5310777 commit 3f67baa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/lwt/lwt_jsonp.ml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ let raw_call name uri error_cb user_cb =
Js.Opt.iter script##.parentNode (fun parent -> Dom.removeChild parent script)
in
let executed = ref false in
Js.Unsafe.set Dom_html.window (Js.string name) (fun x ->
executed := true;
finalize ();
user_cb x);
Js.Unsafe.set
Dom_html.window
(Js.string name)
(Js.wrap_callback (fun x ->
executed := true;
finalize ();
user_cb x));
script##.src := Js.string uri;
script##._type := Js.string "text/javascript";
script##.async := Js._true;
Expand Down

0 comments on commit 3f67baa

Please sign in to comment.