- plain ol' React
let state = initial
render(view(state), element)viewis pure!
| type json = Js.Json.t; | |
| let x: json = [%bs.raw {|{"a": [1, "hello", 2, {"b": {"c": [100,200, "d", [10,20,30]]}}]}|}]; | |
| let rec json_to_string json => { | |
| let array_to_string a => a |> Array.to_list |> String.concat ","; | |
| let emitObject o => | |
| "{" ^ | |
| { | |
| let emitKV (key, value) => key ^ ": " ^ json_to_string value; |