Brad Gessler @bradgessler.com · Jan 10

I've complained about Stimulus not being great for components. Here's what I think is great, and I bet a lot of people will think it stinks. 🤣 First, know that I'm using Phlex 2.0. In this example I needed something I could use to copy data to the clipboard. OMG I'm using inline JS events! 😱 🧵👇

5 likes 1 replies

?

Replies

Brad Gessler · Jan 10

Yep, using the event handlers in JS is kinda the same thing as Stimulus's syntax, but with way less `data-` attributes. You can't do this in Phlex 1.x yet, but when @joel.drapper.me releases 2.0, you'll have to use the rc or the repo. Here's what the `clipboard_onclick` helper looks like: