package vdom

  1. Overview
  2. Docs

Module Vdom_blitSource

Rendering "Virtual applications" to concrete ones

Sourcetype Vdom.js_object +=
  1. | Ojs of Ojs.t
Sourcemodule BDecoder : sig ... end
Sourcemodule Encoder : sig ... end
Sourcemodule Cmd : sig ... end
Sourcemodule Custom : sig ... end

Extension hooks (command and custom element handlers)

Sourcetype env
Sourceval cmd : Cmd.handler -> env
Sourceval custom : Custom.handler -> env
Sourceval merge : env list -> env
Sourceval empty : env
Sourceval register : env -> unit

Register global rules (command and custom element handlers). Local ones can also be passed explicitly to run.

Application controller

Sourcetype ('model, 'msg) app
Sourceval run : ?env:env -> ?container:Js_browser.Element.t -> ('model, 'msg) Vdom.app -> ('model, 'msg) app

Instantion a VDOM application into a concrete one, running into a fixed fresh DOM container node.

Sourceval dispose : ('model, 'msg) app -> unit

Dispose all the resources attached to an application. If the container was provided on run, it is emptied on disposal, otherwise it is removed from the DOM.

Sourceval dom : ('model, 'msg) app -> Js_browser.Element.t

Returns the main DOM node that serves as the container for a Vdom application.

Sourceval process : ('model, 'msg) app -> 'msg -> unit

Inject a message into a VDOM application.

Sourceval get : ('model, 'msg) app -> 'model

Get the current model of the VDOM application.

Sourceval after_redraw : ('model, 'msg) app -> (unit -> unit) -> unit

Execute the callback after the next redraw

OCaml

Innovation. Community. Security.