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
49
50
open! Core
open! Async_kernel
open Bonsai.For_open
open! Import
module type S = sig
module Input : T
module Model : sig
type t [@@deriving equal, sexp]
val default : t
end
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
: ?optimize:bool
-> ('input Value.t -> Vdom.Node.t Computation.t)
-> (module S with type Input.t = 'input and type Extra.t = unit)
end