Skip to content
Merged
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
4 changes: 4 additions & 0 deletions packages/client/src/composables/onContentUpdated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ import type { ContentUpdatedCallback } from '../types/index.js'
* in the DOM.
*/
export const onContentUpdated = (fn: ContentUpdatedCallback): void => {
// callbacks are only invoked on client side, and components are never
// unmounted in ssr, so skip registering to avoid retaining them forever
if (__VUEPRESS_SSR__) return

contentUpdatedCallbacks.add(fn)
onUnmounted(() => {
contentUpdatedCallbacks.delete(fn)
Expand Down
Loading