chore: Performance optimizations

# What's changed?

* Remove keys
* Stabilize props
* Force reset store on unmount
This commit is contained in:
Braks
2022-04-24 13:34:22 +02:00
parent ad07b5b6ea
commit b6d8b57859
9 changed files with 73 additions and 44 deletions
+5 -2
View File
@@ -106,7 +106,8 @@ export default (options?: Options): UseVueFlow => {
scope.vueFlowId = name
onScopeDispose(() => {
storage.remove(name)
vueFlow!.$reset()
storage.remove(vueFlow!.id)
vueFlow = null
})
}
@@ -116,7 +117,9 @@ export default (options?: Options): UseVueFlow => {
if (!vueFlow) throw new Error('[vueflow]: store instance not found.')
if (scope) provide(VueFlow, vueFlow)
if (scope) {
provide(VueFlow, vueFlow)
}
return vueFlow
}