4 ms·
:) property access is a little bonkers in hyperscript you can say set the todo's name to "Do the laundry" or set the name of the todo to "Do the laundry
by recursivedoubts 4y ago
:) property access is a little bonkers in hyperscript
you can say
set the todo's name to "Do the laundry"
or
set the name of the todo to "Do the laundry"
or
set name.todo to "Do the laundry"
"the" is white space in the language (allowed before any expression) and helps w/ readability (according to taste)
The first form is what I would recommend in most cases.
The second form is useful when you want to either highlight the property being set or when you want to tweak how the property binds (e.g. to avoid parenthesizing)
The third form is just there because JavaScript, but it works :)
glad you are enjoying the language!
- droobles 4y agoI am definitely enjoying the language, I think the ideas in htmx + hyperscript have massive potential to shift not only frontend, but some fun scripting in Node as well! For that, I am grateful to you. Would love to get involved anyway I can, might start digging through issues in the repository, I learned quite a bit reading hyperscript's source.
- recursivedoubts 4y agosure, jump on the discord: https://htmx.org/discord https://htmx.org/discord there is a hyperscript channel the hyperscript parser is definitely idiosyncratic (i joke that i did the opposite of everything my compilers professor taught me) but once you see the patterns it isn't too bad