While reading The Stimulus Trigger Pattern blog post I came across Stimulus code that I didn’t recognise.
On checking the Stimulus documentation, I found the Connected and Disconnected Callbacks section.
Where a Stimulus controller is connected to an element, it will listen for newly added elements with
data-xxx-target="some-target" and call the
This is useful when turbo appends new elements to the page.