@xyflow/svelte
Version:
Svelte Flow - A highly customizable Svelte library for building node-based editors, workflow systems, diagrams and more.
27 lines (26 loc) • 648 B
JavaScript
import { useStore } from '../store';
/**
* Hook for seeing if nodes are initialized
* @returns A boolean that indicates if nodes are initialized
* @public
*/
export function useNodesInitialized() {
const { nodesInitialized } = $derived(useStore());
return {
get current() {
return nodesInitialized;
}
};
}
/**
* Hook for seeing if the viewport is initialized
* @returns - reactive viewportInitialized
*/
export function useViewportInitialized() {
const { viewportInitialized } = $derived(useStore());
return {
get current() {
return viewportInitialized;
}
};
}