Rocket Counter Pro
Rocket is currently in alpha – available in the Datastar Pro repo.
Explanation #
A minimal Rocket component showing local actions. The increment action is registered with action({ name, apply }) 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>