by jcormont · 7y ago · 0 comments
Anyway, yes Typescene does let you supply an actual function in place of the string here, but for me that ruins the 'neat' flow of the view and starts mixing views with logic.
onclick: () => function_to_be_defined_at_runtime()
This also lets you deal with functions that are defined at runtime. Moreover, this actually lets you provide types for the expected callbacks.> but for me that ruins the 'neat' flow of the view and starts mixing views with logic.
How is providing a reference to a function "logic"? You still provide a reference to a method, only you do it in an unspecified stringly-typed DSL.
Be sides, you're using these magical strings in so, so many places: https://news.ycombinator.com/item?id=20310666
This is anything but strongly typed. This is stringly typed.