strudel
strudel copied to clipboard
Allow to attach multiple components to the same DOM node.
Is your feature request related to a problem? Please describe.
The problem that I have is that sometimes there are multiple functionalities that need to be attached to the same DOM node. For example I might have a custom element ('.custom-component') that has some JS logic and on top of it I might want to allow to attach some animations to it (that will be generic to all components .animate-component
) that also uses some JS. For example to trigger it when it will be in view (via intersection observer).
While I can do some of it with a mixins not all functionalities are supported and even if they would be I will have to write custom logic to attach it by checking the class to enable it. And even if this theoretically will be possible I would have to attach it to ALL components that I do have.
Describe the solution you'd like I would like to attach 2 separate component logic to the same DOM node.
Describe alternatives you've considered Currently I'm using normal JS classes and registering it by hand while having a lot of code duplicated - boilerplating component behaviour and initialisation.
Additional context None