123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293open!Coreopen!Js_of_ocamlmoduletypeInput=sigtypet[@@derivingsexp_of](* [combine first second] describes how more than one of the same hook should
be merged. This function will only be used if the hooks are combined
using [Attr.many]'s merge semantics. It is common for [t] to by
a function type like ['a -> unit Ui_effect.t]; in this case, the proper
implementation is probably the following:
{[
let combine f g event =
Vdom.Effect.sequence_as_sibling
(f event)
~unless_stopped:(fun () -> g event)
]} *)valcombine:t->t->tendmoduletypeS=sigmoduleState:TmoduleInput:Input(** [init] is called the first time that this attribute is attached to
a particular node. It is particularly responsible for producing a value
of type [State.t]. The element that it is being attached to is not
necessarily attached to the rest of the DOM tree. *)valinit:Input.t->Dom_html.elementJs.t->State.t(** [on_mount] is called once, after the element is attached to the rest of the
DOM tree. *)valon_mount:Input.t->State.t->Dom_html.elementJs.t->unit(** [update] is called when a previous attribute of the same kind existed on
the vdom node. You get access to the [Input.t] that the previous node was
created with, as well as the State.t for that hook, which you can mutate if you
like. There is no guarantee that [update] will be called instead of
a sequence of [destroy] followed by [init], so [update] should behave the
same as that sequence (except it might be faster). *)valupdate:old_input:Input.t->new_input:Input.t->State.t->Dom_html.elementJs.t->unit(** [destroy] is called when the previous vdom has this hook, but a newer
vdom tree does not. The last input and state are passed in alongside the
element that it used to be attached to. *)valdestroy:Input.t->State.t->Dom_html.elementJs.t->unitendmoduletypeHooks=sigmoduletypeS=SmoduletypeInput=Inputtypetvalcombine:t->t->tvalpack:t->Js.Unsafe.anymoduleMake(S:S):sig(** [name] is a unique identifier that is treated like the names of regular
attributes like "id" and "class" in <div id=... class=...> in that
there can only be one attribute with the same name on an element, and
that hooks are diffed only if the same hook has the same name between
stabilizations. *)valcreate:S.Input.t->tmoduleFor_testing:sig(** The type-id provided here can be used to pull out the input value for
an instance of this hook for testing-purposes. *)valtype_id:S.Input.tType_equal.Id.tendendmoduleFor_testing:sigmoduleExtra:sigtypet=|T:{type_id:'aType_equal.Id.t;value:'a}->tvalsexp_of_t:t->Sexp.tendendend