alba

Alba compiler
Library alba.fmlib_js
Module Fmlib_js . Browser . Make

Parameters

Signature

module Vdom = App.Dom
module Command = App.Command
module Subscription = App.Subscription
module Tree : sig ... end
type ('model, 'msg) t = {
window : window Js_of_ocaml.Js.t;
root : node Js_of_ocaml.Js.t;
view : 'model -> 'msg Vdom.t;
update : 'msg -> 'model -> 'model * 'msg Command.t;
subscription : 'model -> 'msg Subscription.t;
mutable model : 'model;
mutable dirty : bool;
mutable tree : 'msg Tree.t option;
}
val make : window Js_of_ocaml.Js.t -> node Js_of_ocaml.Js.t -> 'model -> ( 'model0 -> 'msg Vdom.t ) -> ( 'msg0 -> 'model1 -> 'model1 * 'msg0 Command.t ) -> ( 'model2 -> 'msg1 Subscription.t ) -> ( 'model3, 'msg2 ) t
val view : ( 'model, 'msg ) t -> 'msg0 Vdom.t
val update : 'msg -> ( 'model, 'msg0 ) t -> unit
val do_command : ( 'model, 'msg ) t -> 'msg0 Command.t -> unit
val make_event_handler : ( 'model, 'msg ) t -> 'msg0 Decoder.t -> ( Fmlib.Common.Void.t Js_of_ocaml.Js.t -> unit ) Js_of_ocaml.Js.callback
val make_tree : ( 'model, 'msg ) t -> 'msg0 Vdom.t -> 'msg1 Tree.t
val remove_children : node Js_of_ocaml.Js.t -> unit
val update_dom : ( 'model, 'msg ) t -> unit
val animate : ( 'model, 'msg ) t -> float -> unit
val sandbox : 'model -> ( 'model0 -> 'msg Vdom.t ) -> ( 'msg0 -> 'model1 -> 'model1 ) -> unit
val element : 'a Decoder.t -> ( 'a0 -> 'model * 'msg App.Command.t ) -> ( 'model0 -> 'msg0 Vdom.t ) -> ( 'msg1 -> 'model1 -> 'model1 * 'msg1 App.Command.t ) -> ( 'model2 -> 'msg2 App.Subscription.t ) -> unit