Commits

camlspotter  committed 131dd3c

xLwt

  • Participants
  • Parent commits 9edcf03

Comments (0)

Files changed (4)

File lib/OMakefile

     std
     xUnsafe
     unsafe
+    xLwt
     http
     google
 
 
 let alert s = ignore (Js.Unsafe.fun_call (Js.Unsafe.variable "alert") [| Js.Unsafe.inject (Js.string s) |])
 
+module Lwt = XLwt
+module Lwt = struct
+  include Lwt
+  include Lwt_js
+end
+
+include Lwt

File test/chart.ml

 open XJs
 open Std
 open Google
-open Lwt
+open XLwt (* Some functions of Lwt is overridden by Lwt_js *)
 
 let _ = google##load (Js.string "visualization", Js.string "1.0", Unsafe.literal "{'packages':['corechart']}")
 
     | Some div -> div
   in
   let chart = jsnew (google##visualization##_ScatterChart) (div) in
-  chart##draw(data, options);
 
   ignore begin
     Data.get "data.txt" >>= fun rows ->
       | [] -> return ()
       | (x,y)::xys ->
           data##addRows(Js.array [| Js.array [| int x; int y; |] |]);
-          Lwt_js.sleep 0.2 >>= fun () ->
+          chart##draw(data, options); (* CR jfuruse: It would be costy! *)
+          Lwt.sleep 0.1 >>= fun () ->
           iter xys (* It seems not to be executed.... Hmmm *)
     in
     iter rows