Comments (5)
Thanks for bringing this up. Turbo has a solution for this, but I don't think it's documented or shown in the demo. When Turbo submits a form that redirects, it will automatically follow that redirect as you noticed. It will then propose a visit to the app. That VisitProposal
though will include the full response from the redirect in the proposal.options
. You can pass that response to the next visit and it will use it instead of making another request. It also has the advantage of rendering immediately.
let options: VisitOptions = ... // options saved from previous visit proposal
session.visit(visitable, options: options)
I'll add an example of that to the demo project.
from turbo-ios.
Great, thanks @zachwaugh - I will give that a try once the demo's updated. I know it's probably not your domain, but do you know if the same approach will work for turbo-android?
from turbo-ios.
I believe Android works the same way, but @jayohms can confirm.
from turbo-ios.
Okay I tested that code snippet, and it seems to work well for this particular issue.
Is there ever a reason to call session.visit
without the options
argument? The only case I can think of is on initial boot, at which point options
would be nil
anyway.
from turbo-ios.
Mostly just for convenience. If you omit options
, it uses the default options, which is just an advance
action and no response - https://github.com/hotwired/turbo-ios/blob/main/Source/Session/Session.swift#L64.
from turbo-ios.
Related Issues (20)
- Turbo for react native. HOT 1
- Turbo reload breaks webview HOT 1
- Submitting forms via form.submit() broken? HOT 3
- [Feature request] Add `pull_to_refresh_enabled` HOT 2
- accessing route params HOT 3
- Supporting OAuth (omniauth) flows
- Turbo visit with replace action flashes elements HOT 1
- data-turbo-permanent: true doesn't work on ios unless in turbo frame
- `session.reload()` doesn't work with Turbo Stream properly
- Pull to refresh doesn't work after modal dismissed. HOT 1
- Unable to build demo: "Missing package product 'Strada'" HOT 1
- [Question] Is there a way to use Turbo web sockets with native code HOT 3
- Trix Strada component HOT 3
- Handle navigations to files by default HOT 1
- Links using data-turbo-confirm not working with Turbo iOS HOT 2
- File field clicking Take Photo or Video crashes app. HOT 2
- Back navigation will reload the page HOT 10
- Quick start guide: pageLoadFailure on successful request HOT 11
- Blank WebViews Issue resurfacing HOT 6
- Can't find a way to render error page HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbo-ios.