ic-action does not support chained derefences
jvosloo opened this issue · 5 comments
We have been scoping our JS code using the module pattern, in order to avoid polluting the global namespace.
Now we've run into exactly the issue as described here: https://gitter.im/intercooler-js/Lobby?at=5c69ae5480df6804a1bf2170 , i.e. ic-action not supporting method derefencing. I know we can work around it with the event-based approach as described, but it is quite crappy to have all these event handlers all over the show, when ic-action is just so much more elegant and concise.
@chg20 I know you're furiously busy with HTMX ... but is there any chance of getting this squeezed in? 😬
@jvosloo OK, so you want to do something like:
<div ic-action="someObject.foo:'arg1', 'arg2'">Click Me</div>
Basically support dot-dereferencing in the initial component of the action?
I pushed up a change that should fix this, if you want to grab the source out of dev.
For completeness, in htmx this would be solved with hyperscript:
<div _="on click call someObject.foo('arg1', 'arg2')">Click Me</div>
And if I understand alpine.js
correctly, it would be:
<div @click="someObject.foo('arg1', 'arg2')">Click Me</div>
And I should say, nice to see you Johan! :)
Carson - you're da man, man! 😁
I'm salivating over HTMX, but we're heavily invested in Intercooler .. in fact, we're busy expanding our usage right now again!
I'm hoping you're still going to keep an eye on it for a good while 😅
I'm not entirely sure about the workflow, whether I can close this issue, now that the change is in the development branch?
I guess so :)