Module Sharp_event

module Sharp_event: sig .. end
Functions to create signals from JS events.

val make : ?prevent_default:bool ->
(#Dom_html.event as 'a) Js.t Dom.Event.typ ->
((#Dom_html.eventTarget as 'b) Js.t -> 'a Js.t -> 'c option) ->
'b Js.t -> 'c option Sharp_core.t * (unit -> unit)
Create a signal from a JS event on a DOM element.

The callback receives the event target and the event itself and returns a value only if the signal should take a value. It returns the signal as well as a function which unbinds the signal when called.

val make_unit : ?prevent_default:bool ->
#Dom_html.event Js.t Dom.Event.typ ->
#Dom_html.eventTarget Js.t -> unit option Sharp_core.t * (unit -> unit)
A convenient specialised version of make for signals that always take the unit value.
val click : ?prevent_default:bool ->
#Dom_html.eventTarget Js.t -> unit option Sharp_core.t * (unit -> unit)
val submit : ?prevent_default:bool ->
#Dom_html.eventTarget Js.t -> unit option Sharp_core.t * (unit -> unit)
val change : ?prevent_default:bool ->
((#Dom_html.eventTarget as 'a) Js.t -> Dom_html.event Js.t -> 'b option) ->
'a Js.t -> 'b option Sharp_core.t * (unit -> unit)
val input : ?prevent_default:bool ->
((#Dom_html.eventTarget as 'a) Js.t -> Dom_html.event Js.t -> 'b option) ->
'a Js.t -> 'b option Sharp_core.t * (unit -> unit)
val hashchange : ?prevent_default:bool ->
(Dom_html.window Js.t -> Dom_html.hashChangeEvent Js.t -> 'a option) ->
'a option Sharp_core.t * (unit -> unit)
val popstate : ?prevent_default:bool ->
(Dom_html.window Js.t -> Dom_html.popStateEvent Js.t -> 'a option) ->
'a option Sharp_core.t * (unit -> unit)