Closed preetsethi closed 5 years ago
Hey @preetsethi, thanks for submitting the issue! Explaining everything in details really helped, thank you once again!
Sorry for making this bug, I will try to resolve it ASAP and release a new version that fixes it.
I've just released https://rubygems.org/gems/render_async/versions/2.1.2, let me know if it works for you @preetsethi
Hey there!
First and foremost, thanks for all the work with render_async, we use it everyday in production!
I was the guy using the toggle feature prior to your release. After updating to 2.1.1, I noticed some strange behavior: when turbolinks is enabled, the
_renderAsyncFunction
will fire regardless of the toggle configuration.I believe this little section of code is responsible
I'm sending you a quick PR, let me know if you want me to change anything.
If this isn't the intended behavior, could you please elaborate on your thinking?
Thanks!
edit:
Realized I can probably clarify and describe our use case a bit more.
Assume the following
render_async
call:Basically we render a button as a placeholder and the button contains the toggle selector. With turbolinks off, everything functions as expected: when you click the button, render_async works its magic and loads the partial, replacing the button with some awesome stats for our customers.
When turbolinks config is enabled, the partial is loaded on turbolinks:load regardless of any toggle configuration. It took me a while to actually root this out because I use all of the following:
and I did not want to file an issue prematurely.
We're running my branch in staging now and everything is functioning as expected. We even have a render_async call with caching, toggle, and interval + turbolinks, and it's working well on our initial evaluation.
Once again, thanks!