Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add a visitRendered() callback that web fragments can use #223

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ internal class TurboWebFragmentDelegate(
}

override fun visitRendered() {
callback.onVisitRendered(location)
navDestination.fragmentViewModel.setTitle(title())
removeTransitionalViews()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ interface TurboWebFragmentCallback {
*/
fun onVisitStarted(location: String) {}

/**
* Called when a Turbo visit has rendered (from a cached snapshot or
* from a fresh network request). This may be called multiple times
* during a normal visit lifecycle.
*/
fun onVisitRendered(location: String) {}

/**
* Called when a Turbo visit has completed.
*/
Expand Down