Unicorn_jsoo.EHTML events.
Just like attributes, events are specified inside the HTML node children and attach to their closest parent.
val click : ( 'a -> 'a ) -> 'a tclick fn invokes the callback fn when its HTML parent node is clicked.
∀ f g. click f & click g == click (fun x -> g (f x))∀ i f. iso i (click f) == click (Iso.map i f) and same for lenses and prismsval doubleclick : ( 'a -> 'a ) -> 'a tval keydown : ( int -> 'a -> 'a ) -> 'a tval blur : ( 'a -> 'a ) -> 'a tval init :
( Js_of_ocaml.Dom_html.element Js_of_ocaml.Js.t -> 'a -> 'a ) ->
'a tinit fn calls fn once on the creation of the HTML widget.
val init_focus : unit -> 'a tinit_focus () focuses the HTML parent element on creation.
val now : ( float -> 'a -> 'a ) -> 'a tnow fn invokes the callback fn on every frame with the current time and state.
val dt : ( float -> 'a -> 'a ) -> 'a tdt fn invokes the callback fn on every frame with the delta time and state.
Consider submitting a PR if you find yourself using this!
val make :
_ Js_of_ocaml.Dom.event Js_of_ocaml.Js.t as 'e Js_of_ocaml.Dom_html.Event.typ ->
( 'e -> 'a -> 'a ) ->
'a tmake ev callback attaches a new event handler to the HTML parent node.