The question of how to keep things DRY (Don’t Repeat Yourself) comes up often when using Datastar. One commonly used example concerns preventing the repetition of a backend action.
The common misconception is that Datastar should provide shorthand syntax for the repeated @get action. The answer is that this should be solved using your templating language. For example:
This is the pattern that both the Blinksy and Checkboxes demos use to prevent registering multiple event listeners for the same action, while being able to send a corresponding ID for each button clicked.