package bonsai

  1. Overview
  2. Docs
A library for building dynamic webapps, using Js_of_ocaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.15.1.tar.gz
sha256=0c4a714146073f421f1a6179561f836b45d8dc012c743207d3481ea63bef74bf

doc/src/bonsai.web/to_incr_dom_intf.ml.html

Source file to_incr_dom_intf.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
open! Core
open! Async_kernel
open! Bonsai
open! Import

module type S = sig
  module Input : T

  module Model : sig
    type t [@@deriving equal, sexp]

    val default : t
  end

  module Extra : T

  module Action : sig
    type t [@@deriving sexp_of]
  end

  module State : sig
    type t

    val create : unit -> t
  end

  type t = (Action.t, Model.t, State.t, Extra.t) Incr_dom.Component.with_extra

  val create
    :  input:Input.t Incr.t
    -> old_model:Model.t option Incr.t
    -> model:Model.t Incr.t
    -> inject:(Action.t -> unit Vdom.Effect.t)
    -> t Incr.t
end

module type To_incr_dom = sig
  (** A wrapper to use Bonsai components in Incr_dom apps. *)
  module type S = S

  val convert
    :  ('input Value.t -> Vdom.Node.t Computation.t)
    -> (module S with type Input.t = 'input and type Extra.t = unit)

  val convert_with_extra
    :  ('input Value.t -> (Vdom.Node.t * 'extra) Computation.t)
    -> (module S with type Input.t = 'input and type Extra.t = 'extra)
end
OCaml

Innovation. Community. Security.