I am using a view component library that lets me write Ruby in ERB views, rendering components, controlled by Stimulus controllers.
So I see an element in the DOM with data-controller=“fizzy”. The JS for this is pre-written and does work. Clearly, I do not write this code, and it functions on events in the component. One of the key events is “AllDoneNicely”.
I want to listen for AllDoneNicely, so I can do something. If I make my own controller, register it, and assign it to fizzy, it never seems to fire. My connect() never logs to console.
So I am assume one can only register a controller once? If so, how does one tap into Stimuls elements like this? How can I listen to the component myself for things?