Idea for expression evaluation "mixin" #74
Unanswered
rainerborene
asked this question in
Ideas
Replies: 1 comment
-
Hey It is totally fine to post idea here as we don't have yet the Github discussion tab enabled on the repo !!!! This looks like a great idea and it would be a great addition to Stimulus Use. I agree that they are several nice things available in the Vue/Alpine world that could be valuable in Stimulus. Not sure how this could be achieved but if we could bind action to If you feel like opening a PR it would be very welcome. and let me know if you would need some guidance to get started. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to open a discussion and not sure if this would be the place to do so. But I think it could be very beneficial to the Stimulus.js community. I started playing around the idea of implementing a simple (and naive) inline expression evaluation like what
vue
andalpine.js
does have. There are projects likestimulus-bind
andstimulus-data-bindings
that implements it but both are somewhat complex (or too boilerplate code) in my opinion.Let me show you the prototype code:
_form.html.erb
tabs_controller.js
evaluate.js
I think it would be cool if
stimulus-use
could provide such mixin that allows you to interact with any controller inside thedata-evaluate
scope and set thevalue
or any otherHTMLElement
attribute "automagically".Beta Was this translation helpful? Give feedback.
All reactions