Skip to content

feat: use-preview-mode custom callbacks#28371

Merged
danielroe merged 3 commits intonuxt:mainfrom
adamdehaven:feat/use-preview-mode-configurable-callbacks
Aug 8, 2024
Merged

feat: use-preview-mode custom callbacks#28371
danielroe merged 3 commits intonuxt:mainfrom
adamdehaven:feat/use-preview-mode-configurable-callbacks

Conversation

@adamdehaven
Copy link
Copy Markdown
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.

@adamdehaven adamdehaven requested a review from danielroe as a code owner July 31, 2024 17:39
@bolt-new-by-stackblitz
Copy link
Copy Markdown

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

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