package virtual_dom

  1. Overview
  2. Docs
OCaml bindings for the virtual-dom library

Install

Dune Dependency

Authors

Maintainers

Sources

v0.15.1.tar.gz
sha256=7f1fa83287458114c5b0cab8aae00d69972d15e1d20a446ce13f246aacef3216

doc/virtual_dom.input_widgets/Vdom_input_widgets/Button/index.html

Module Vdom_input_widgets.ButtonSource

Sourceval simple : ?extra_attrs:Virtual_dom.Vdom.Attr.t list -> ?disabled:bool -> string -> on_click:(unit -> unit Virtual_dom.Vdom.Effect.t) -> Virtual_dom.Vdom.Node.t

Though simple is fairly trivial, it is provided as a convenient parallel to with_validation

Sourceval with_validation : ?extra_attrs:Virtual_dom.Vdom.Attr.t list -> string -> validation:('a, string) Core.Result.t -> on_click:('a -> unit Virtual_dom.Vdom.Effect.t) -> Virtual_dom.Vdom.Node.t

Takes a ('a, string) Result.t that is typically the result of some validation performed incrementally. If the validation failed, the button will be disabled and will show a tooltip on hover with the error reason. If the validation is ok, the 'a is passed to the on_click handler. You can compose multiple validity checks with the Result applicative interface.

OCaml

Innovation. Community. Security.