B
B
Breezy
Search…
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:
1
import { urlToPageKey } from '@thoughtbot/superglue/utils/url'
2
3
const appVisit = (...args) => {
4
5
const pageKey = urlToPageKey(args[0])
6
// attempt to navigate first
7
this.ref.current.navigateTo(pageKey)
8
9
return store
10
.dispatch(visit(...args))
11
....
Copied!
Last modified 16d ago
Copy link