when I was using this library for the first time, I thought the z.helper API was neat
however, can't the same be done by interpolating expressions directly into the string?
e.g., instead of
z.helper({
bo: 'border'
})
z`
bo 4 solid red
`
do
z`
${bo(4, 'solid', 'red')}
`
collateral benefit: also results in straightforward type-checking if you're using e.g. TypeScript
this could also be z.style in the "post-processing" phase for effects which depend on updated values (after a hook has triggered an update, for instance)
Is there some advantage I'm failing to see in there? My current impression is that those custom functions are more flexible and also would help in reducing the API.
when I was using this library for the first time, I thought the
z.helperAPI was neathowever, can't the same be done by interpolating expressions directly into the string?
e.g., instead of
do
collateral benefit: also results in straightforward type-checking if you're using e.g. TypeScript
this could also be
z.stylein the "post-processing" phase for effects which depend on updated values (after a hook has triggered an update, for instance)Is there some advantage I'm failing to see in there? My current impression is that those custom functions are more flexible and also would help in reducing the API.