module Snabbdom_data:sig
..end
type
t
Essentially this is just a standard JavaScript object. For example:
{
style: {
color: '#000',
'font-weight': 'bold'
},
on: {
click: function(e) { e.preventDefault() }
}
}
val empty : unit -> t
{}
val set_in_path : t -> string array -> 'a -> t
Pass an array of strings representing the path to the property to be set, followed by the property value. Intermediate objects will be created if they don't already exist.
For example, to add a property like the following (in JavaScript):
{ style: { color: '#000' } }
Use:
let data = set_in_path data [|"style"; "color"|] "#000"