4 ms·
If you haven't seen the Bonsai OCaml library, they provide an arrow based interface for making web apps. I find it very straight forward to use and everything i
by sweetsocks21 6y ago
If you haven't seen the Bonsai OCaml library, they provide an arrow based interface for making web apps. I find it very straight forward to use and everything is based around composing functions. A "component" is:
type ('a, 'b) t = 'a Value.t -> 'b Computation.t
and then there's various ways to hook them up and depend on each other.
https://github.com/janestreet/bonsai/blob/master/docs/proc.md https://github.com/janestreet/bonsai/blob/master/docs/proc.m...
Gives a bit of an overview. There are some syntax extensions to make working with it a bit easier. But once grokked it seems to fit nicely, and feels like more of a solid foundation than React (imo).
Not all the examples have been updated to the new style, but here's one (albeit trivial) example:
https://github.com/janestreet/bonsai/blob/master/examples/two_instances_of_component/main.ml https://github.com/janestreet/bonsai/blob/master/examples/tw...