How to run a Javascript following a Turbo request

Опубликовано: 02 Апрель 2026
на канале: Winston Codes On
640
9

Sometimes after the user completes a Turbo request, you might want to run something in Javascript to change the state of the page. I show you a technique to feed such a cue into a Stimulus controller!

Source code link (must be a Patreon member to access):
https://github.com/wakproductions-pat...
  / winstonkotzan  

Tip me in BTC! Bitcoin Address: 13FKUusPH1UPvgSkoQRRy6hEg4hyMqKzLS

0:00 Reasons to run JS after a Turbo request
1:59 Biz logic problem for my application
5:31 Using the DOM to store hidden state information
8:21 Exploiting the Stimulus JS connect() function
9:11 Turbo/Stimulus combo to dispatch JS events

Outtro Music:
Carl Casey White Bat Audio - Nightmare City
   • Cyberpunk Synthwave - Nightmare City // Ro...