fix: suspension not working properly

* move invoke to vueflow to suspend
* await dimensions in Node/Edge-wrapper components
* await nodes/edges in renderer
* await elements in VueFlow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-20 02:00:37 +01:00
parent a4e3bf52c7
commit d25fa579e4
6 changed files with 63 additions and 59 deletions
+3 -1
View File
@@ -1,6 +1,7 @@
<script lang="ts" setup>
import { CSSProperties, onBeforeUnmount } from 'vue'
import diff from 'microdiff'
import { invoke } from '@vueuse/core'
import {
ConnectionLineType,
ConnectionMode,
@@ -126,7 +127,7 @@ const init = (state: FlowState) => {
}
onBeforeUnmount(() => store?.$dispose())
init(options)
onMounted(() => init(options))
watch(elements, (val) => store.setElements(val), { flush: 'post', deep: true })
watch(
() => store.elements,
@@ -146,6 +147,7 @@ watch(
},
{ flush: 'pre', deep: true },
)
invoke(async () => await until(store.elements).toMatch((y) => y.length > 0))
</script>
<template>
<div class="vue-flow">