package bonsai

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

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
open! Core_kernel
open! Async_kernel
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

  type t = (Action.t, Model.t, unit, 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 -> Vdom.Event.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, Vdom.Node.t) Bonsai.t
    -> (module S with type Input.t = 'input and type Extra.t = unit)

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

Innovation. Community. Security.