I’m using stimulus on a side project and I wanted to create a Mixin (aka methods you can inject in a controller) to avoid duplication of my code in different controllers.
You can extend controllers as described here to inherit the targets/methods. That’s been pretty useful for me.
You can also have multiple stimulus controllers per DOM element, essentially letting you mix and match groups of behaviors on the fly. I find it nicest to keep stimulus methods concerned with just responding to events on targets and light data/dom manipulation and tuck more complex logic away in other modules.