package alba
Alba compiler
Install
Dune Dependency
Authors
Maintainers
Sources
0.4.4.tar.gz
sha256=4817038301d3e45bac9edf7e6f2fc8bf0a6d78e76e02ad7ea33ef69bcc17df3b
md5=25234357587126685d64f16236167937
doc/src/alba.fmlib_node/readline.ml.html
Source file readline.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
open Js_of_ocaml open Js class type js_iface = object method question: js_string t -> (js_string t -> unit) callback -> unit meth method close: unit meth method on: js_string t -> (unit -> unit) callback -> unit meth method removeListener: js_string t -> (unit -> unit) callback -> unit meth end type iface = js_iface t let create_interface (): iface = Unsafe.eval_string "require('readline').createInterface(\ {input: process.stdin, output: process.stdout})" let question (rl:iface) (prompt:string) (cmd:string -> unit) (stop:unit -> unit) : unit = let cb = wrap_callback stop and str_close = string "close" in rl##on str_close cb; rl##question (string prompt) (wrap_callback @@ fun jstr -> rl##removeListener str_close cb; cmd (to_string jstr)) let close (rl:iface): unit = rl##close
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>