Rocket Counter Pro
Rocket is currently in alpha – available with Datastar Pro.
Explanation #
A minimal Rocket component showing local actions. The actions.increment function lives inside the component and is called from data-on:click. Each instance keeps its own $$count.
Usage Example #
Rocket Component #
Declarative Variant #
The declarative version is preferred for simple cases. The script-based version above illustrates how to expose custom actions when you need them.
Usage Example #
1<my-counter-declarative count="3"></my-counter-declarative>