Skip to content

Commit

Permalink
hotfix for js_of_ocaml#1589
Browse files Browse the repository at this point in the history
  • Loading branch information
haochenx committed Mar 22, 2024
1 parent c11b0c1 commit ca66d5b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/fut.ml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ let of_list fs =
let to_list l = Jv.Promise.resolve (Jv.to_list Obj.magic l) in
fut @@ Jv.Promise.bind all to_list

(* NB: this function contains prr-only bug-fix suggested in
https://github.com/ocsigen/js_of_ocaml/issues/1589#issuecomment-2014892340
which is not (yet) in brr yet *)
let tick ~ms =
fut @@ Jv.Promise.create @@ fun res _rej ->
ignore (Jv.apply (Jv.get Jv.global "setTimeout") Jv.[| repr res; of_int ms |])
ignore (Jv.apply (Jv.get Jv.global "setTimeout") Jv.[| callback ~arity:1 res; of_int ms |])

(* Converting with JavaScript promises *)

Expand Down

0 comments on commit ca66d5b

Please sign in to comment.