Skip to content

Commit e50cf0c

Browse files
authored
fix(vue): avoid reactive dependency leak (#234)
1 parent ae7e14e commit e50cf0c

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

.changeset/floppy-carrots-sing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@prosemirror-adapter/vue': patch
3+
---
4+
5+
Stop `updateContext` from leaking reactive subscriptions to outer effects.

packages/vue/src/markView/VueMarkView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export abstract class AbstractVueMarkView<ComponentType>
2222

2323
updateContext = (): void => {
2424
const ctx = this.context
25-
if (ctx.mark.value !== this.mark) ctx.mark.value = this.mark
25+
ctx.mark.value = this.mark
2626
}
2727

2828
abstract render: () => VueRendererComponent

packages/vue/src/nodeView/VueNodeView.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ export abstract class AbstractVueNodeView<ComponentType>
2828

2929
updateContext = () => {
3030
const ctx = this.context
31-
if (ctx.node.value !== this.node) ctx.node.value = this.node
32-
if (ctx.selected.value !== this.selected) ctx.selected.value = this.selected
33-
if (ctx.decorations.value !== this.decorations) ctx.decorations.value = this.decorations
34-
if (ctx.innerDecorations.value !== this.innerDecorations) ctx.innerDecorations.value = this.innerDecorations
31+
ctx.node.value = this.node
32+
ctx.selected.value = this.selected
33+
ctx.decorations.value = this.decorations
34+
ctx.innerDecorations.value = this.innerDecorations
3535
}
3636

3737
abstract render: () => VueRendererComponent

0 commit comments

Comments
 (0)