B
B
Breezy
Search…
main
Code of conduct
Changelog
README
Superglue
_sidebar
Concepts
Demo Application
Getting started
navigation
The page response
Rails
React Redux
The store shape
Template querying
updating-fragments
Utility
recipes
Chat app
Custom reducers
Usage with Kaminari
Loading content later
Loading tab content onClick
Modals
Server-Side Rendering
Replicating Turbolinks behavior
Shopping cart
Powered By
GitBook
Replicating Turbolinks behavior
With
visit
, Superglue will always wait for a response before a navigation transition. Turbolink's behavior is to transition first if possible while waiting for the response. To replicate this behavior:
In your
application_visit.js
file:
import
{
urlToPageKey
}
from
'@thoughtbot/superglue/utils/url'
const
appVisit
=
(
...
args
)
=>
{
const
pageKey
=
urlToPageKey
(
args
[
0
])
// attempt to navigate first
this
.
ref
.
current
.
navigateTo
(
pageKey
)
return
store
.
dispatch
(
visit
(
...
args
))
...
.
Previous
Server-Side Rendering
Next
Shopping cart
Last modified
7mo ago
Copy link