Counter App

Demonstrating Stimulus Values API with Opal

Counter Controller

Demonstrates Stimulus Values API with get_value, set_value, increment_value, and decrement_value helpers

Current Count:
0

About this demo:

  • Values API: Uses static values = { count: Number }
  • Helpers: Leverages get_value, set_value, increment_value, and decrement_value
  • Targets: Updates display using data-counter-target="display"
  • Change Callback: Implements count_value_changed to react to value changes