streamline initialized
This commit is contained in:
@@ -1,18 +1,18 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { useNodesInitialized, useInitialized } from '@xyflow/svelte';
|
import { useNodesInitialized, useViewportInitialized } from '@xyflow/svelte';
|
||||||
|
|
||||||
const nodesInitialized = useNodesInitialized();
|
const nodesInitialized = useNodesInitialized();
|
||||||
const initialized = useInitialized();
|
const viewportInitialized = useViewportInitialized();
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (nodesInitialized) {
|
if (viewportInitialized.current) {
|
||||||
|
console.log('viewportInitialized');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$effect(() => {
|
||||||
|
if (nodesInitialized.current) {
|
||||||
console.log('nodes initialized');
|
console.log('nodes initialized');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$effect(() => {
|
|
||||||
if (initialized) {
|
|
||||||
console.log('initialized');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user