Skip to content

Allow providing custom enable/disable callbacks to usePreviewMode #28370

@adamdehaven

Description

@adamdehaven

Describe the feature

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, the linked PR allows passing in two new callbacks to the composable's options.

I've submitted the functionality as a new PR: #28371

Additional information

  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?

Final checks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions