package server-reason-react
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Rendering React components on the server natively
Install
dune-project
Dependency
Authors
Maintainers
Sources
server-reason-react-0.4.1.tbz
sha256=2d27cb4656208dde8d5eb0c452c590186d092618ac0a04f1ab0a095a3ca58498
sha512=26e16daf87f6b80eff86ccf7df29153527b24e3f4dbc7f13820d1507b0a2e7d6db40fd774bcaad6e6cccff0bf19d4a411b95a10a071f9ce92d52bf07eb08f75f
doc/src/server-reason-react.js/Js_dict.ml.html
Source file Js_dict.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(** Provide utilities for JS dictionary object *) type key = string type 'a t = (key, 'a) Hashtbl.t let empty () : 'a t = Hashtbl.create 10 let entries (dict : 'a t) : (string * 'a) array = Hashtbl.fold (fun k v acc -> (k, v) :: acc) dict [] |> Stdlib.Array.of_list let get (dict : 'a t) (k : key) : 'a option = try Some (Hashtbl.find dict k) with Not_found -> None let map ~(f : 'a -> 'b) (dict : 'a t) = Hashtbl.fold (fun k v acc -> Hashtbl.add acc k (f v); acc) dict (empty ()) let set (dict : 'a t) (k : key) (x : 'a) : unit = Hashtbl.replace dict k x let fromList (lst : (key * 'a) list) : 'a t = let length = Stdlib.List.length lst in let dict = Hashtbl.create length in Stdlib.List.iter (fun (k, v) -> Hashtbl.add dict k v) lst; dict let fromArray (arr : (key * 'a) array) : 'a t = let length = Stdlib.Array.length arr in let dict = Hashtbl.create length in Stdlib.Array.iter (fun (k, v) -> Hashtbl.add dict k v) arr; dict let keys (dict : 'a t) = Hashtbl.fold (fun k _ acc -> k :: acc) dict [] |> Stdlib.Array.of_list let values (dict : 'a t) = Hashtbl.fold (fun _k value acc -> value :: acc) dict [] |> Stdlib.Array.of_list let unsafeGet (dict : 'a t) (k : key) : 'a = Hashtbl.find dict k let unsafeDeleteKey (dict : 'a t) (key : key) = Hashtbl.remove dict key
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>