feat: try to dispose states on unmount

Signed-off-by: bcakmakoglu <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
bcakmakoglu
2022-02-21 20:25:17 +01:00
committed by Braks
parent d835e4546c
commit c5b39d4588
10 changed files with 240 additions and 224 deletions
+5
View File
@@ -166,4 +166,9 @@ export default (store: FlowStore = useVueFlow().store) =>
doc.addEventListener('mousemove', onMouseMove as EventListenerOrEventListenerObject)
doc.addEventListener('mouseup', onMouseUp as EventListenerOrEventListenerObject)
onScopeDispose(() => {
doc.removeEventListener('mousemove', onMouseMove as EventListenerOrEventListenerObject)
doc.removeEventListener('mouseup', onMouseUp as EventListenerOrEventListenerObject)
})
}