package vdom
DOM and VDOM for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
0.3.tar.gz
md5=bda1424d08f483a19e242a0c5cff2cfa
sha512=4fbeda115659049798b84b58ce385619bace99740384844eb5a453e2448496e85b304713d1c86d5479b2c3450d17defd1e1f8fa5859ba1e493226c178a6f4cbe
doc/vdom.base/Vdom/Decoder/index.html
Module Vdom.Decoder
Source
Source
type _ t =
| Field : string * 'msg t -> 'msg t
| Method : string * arg_value list * 'msg t -> 'msg t
| Bind : ('a -> 'msg t) * 'a t -> 'msg t
| Const : 'msg -> 'msg t
| Factor : ('a -> 'msg t) -> ('a -> ('msg, string) Result.t) t
| String : string t
| Int : int t
| Float : float t
| Bool : bool t
| Object : js_object t
| List : 'a t -> 'a list t
| Fail : string -> 'msg t
| Try : 'a t -> 'a option t
(*The type of JavaScript object "structural" parsers. It allows to access the fields of JS objects and cast them to OCaml values.
*)
field s d
accesses field s
and applies decoder d
to it. Deeper sub-fields can also be accessed by giving the full list of field names separated by dots.
method_ s l q
calls method s
with arguments l
and applies d
to the result.
factor f
creates a decoder which returns a function which finishes applying the decoder returned by f
with a given argument
list d
decodes a JS array to an OCaml list, applying the decoder d
to each element
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>