Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: use-preview-mode custom callbacks #28371

Merged

Conversation

adamdehaven
Copy link
Contributor

🔗 Linked issue

#28370

📚 Description

The current implementation of usePreviewMode automatically calls refreshNuxtData() when enabling preview mode, as well as binding a useRouter.afterEach(() => refreshNuxtData()) callback that fires on the next route change.

For apps that do not utilize SSG, or apps that desire custom enable/disable setup or cleanup tasks, this PR allows passing in two new callbacks to the composable's options.

Copy link

stackblitz bot commented Jul 31, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe merged commit 83f8617 into nuxt:main Aug 8, 2024
40 checks passed
@github-actions github-actions bot mentioned this pull request Aug 8, 2024
@adamdehaven adamdehaven deleted the feat/use-preview-mode-configurable-callbacks branch August 8, 2024 12:59
@github-actions github-actions bot mentioned this pull request Aug 13, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants