GoRails Screencasts
Refactoring Javascript with Stimulus Values API & Defaults

Refactoring Javascript with Stimulus Values API & Defaults

GoRails Screencasts

20:06

About this episode

Refactoring a Javascript countdown timer into a reusable Stimulus controller gives a look at the flexibility we can achieve by taking advantage of the Stimulus Values API and customizing the default values.

More from GoRails Screencasts

Configuring servers can be tricky, but it's much easier using drop-in configs so you're not editing files that could change across versions or environments.

7m

The Whenever gem is fantastic for defining cron jobs. With a little customization, we can have it monitor cron jobs and report logs, and status to services like AppSignal.

12m

Learn how to use Rails' with_options to DRY up duplicated options across method calls and associations, including how to nest them for shared defaults.

8m