Fork me on GitHub
#shadow-cljs
<
2024-06-27
>
parentheian02:06:25

With js-template is there a way to accomplish a fn call, eg equiv of <div class=${somefn()}></div>

Sam Ferrell03:06:17

what's js-template?

Sam Ferrell03:06:39

just template strings?

parentheian03:06:04

Yeah it’s for doing equiv of templateFn`<div class=${someFn()}></div>`; in js

parentheian03:06:44

Except from what I can tell you can only pass vars and not fn calls

Sam Ferrell03:06:28

i'm not sure you can create template literals in cljs...

parentheian04:06:18

shadow-cljs modern has a macro called js-template that allows for it I am just wondering if it allows for function calls or better (.-method this) style expressions

parentheian04:06:00

Hmm maybe this just works and I am overthinking it

thheller07:06:40

this isn't a js-template, this is jsx?

thheller07:06:41

otherwise its just like you'd do with str, (js-template whatever/tag "<div class=" (some-fn) "></div>")

Sam Ferrell13:06:00

ah my mistake