Hi, I didn't have time to try something out myself but I have an idea.
With this library it's possible to run scripts from a script tag just like scittle but also from a tag with the _ (underscore) attribute. The code is applied to the tag it is found on. Would it be possible to have something like this in scittle as well?
I have something working https://codepen.io/rickheere/pen/NWEJrpY
I needed to save my ref to the element on the window so I can get it back later. Can I improve that somehow?
why not make the scittle attribute a function so you pass the ref:
(fn [{:keys [ref]}] ....)Yeah that works very well, I was not aware js/scittle.core.eval_string would return a function, I thought it would just read and execute code from a string 😅. Thank you!
☝️ code is updated for who is interested.
Sure you can do this in user space with scittle already. Just write some JS interop and use scittle.core/eval_string
Alright I'll try that out when I have some time, thanks.