package virtual_dom

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

Install

Dune Dependency

Authors

Maintainers

Sources

v0.17.0.tar.gz
sha256=812711b4d5ce634a413580cd7096482de8d71abec9ae37bb01f7c0dcec2968ec

doc/virtual_dom.keyboard/Vdom_keyboard/Keyboard_event_handler/Handler/index.html

Module Keyboard_event_handler.HandlerSource

A Handler.t handles a keyboard event by returning a unit Vdom.Effect.t. These should be used as building blocks for keyboard event handlers, for instance to handle a specific set of keys.

include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval with_prevent_default : t -> t

with_prevent_default t handles the event using handler t, and additionally prevents the default handler.

Sourceval only_handle_if : ?prevent_default:unit -> Condition.t -> t -> t

only_handle_if ?prevent_default cond t handles the event using handler t if cond ev evaluates to true (and additionally prevent the default handler if prevent_default is passed in), and does nothing otherwise.

Sourceval handle_by_case : ?prevent_default:unit -> (Condition.t * t) list -> t

handle_by_case is similar to only_handle_if, but allows the user to provide a list of handlers and their respective conditions instead of a single one. If multiple handlers' conditions evaluate to true, the first one is used.

OCaml

Innovation. Community. Security.