Skip to content

rience/stimulus-double-bind

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

This Rails 7 application will demonstrate behaviour when Stimulus is binding twice on new page depending on method used in previous request. If there is a redirect after GET request - then Stimulus will connect to element on new page, disconnect and connect again. But if I change method to POST request and do the same redirect - then I'm only getting single "connect". Please notice that I've opted-out of caching (in layout's head).

Test scenario

  1. Open http://localhost:3000/home/show
  2. Open web developer console to
  3. Click "Test GET" and observe that you'll see - "connect", "disconnect" and "connect" logs
  4. Go back and click "Test POST" and observe that you'll only see single "connect".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors