refactor(core): call nodes initialized whenever areNodesInitialized is true
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getCurrentInstance, inject, nextTick, onBeforeUnmount, onMounted, ref, resolveComponent } from 'vue'
|
import { getCurrentInstance, inject, nextTick, onBeforeUnmount, onMounted, ref, resolveComponent } from 'vue'
|
||||||
import { until } from '@vueuse/core'
|
import { whenever } from '@vueuse/core'
|
||||||
import { NodeWrapper } from '../../components'
|
import { NodeWrapper } from '../../components'
|
||||||
import type { GraphNode, HandleConnectable, NodeComponent } from '../../types'
|
import type { GraphNode, HandleConnectable, NodeComponent } from '../../types'
|
||||||
import { Slots } from '../../context'
|
import { Slots } from '../../context'
|
||||||
@@ -26,13 +26,14 @@ const resizeObserver = ref<ResizeObserver>()
|
|||||||
|
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
|
|
||||||
until(() => areNodesInitialized.value)
|
whenever(
|
||||||
.toBe(true)
|
() => areNodesInitialized.value,
|
||||||
.then(() => {
|
() => {
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
emits.nodesInitialized(getNodesInitialized.value)
|
emits.nodesInitialized(getNodesInitialized.value)
|
||||||
})
|
})
|
||||||
})
|
},
|
||||||
|
)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
resizeObserver.value = new ResizeObserver((entries) => {
|
resizeObserver.value = new ResizeObserver((entries) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user