Modern Front-End Development for Rails: B7 typo page 42 data-attributes

When it sees a data-attribute method, Stimulus sets up a listener on the event which executes the named method on the controller when the event fires

I might be mistaken but it seems that data-attribute should be data-action, that would make more sense to me.

Yeah, I think it should be data-action attribute, actually.