update(zoom): add getElements helper

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-12-20 19:29:52 +01:00
parent 076ff4ce54
commit c82ca4e225
3 changed files with 10 additions and 13 deletions
+3 -2
View File
@@ -1,12 +1,12 @@
<script lang="ts" setup>
import { useStore, useWindow, useZoomPanHelper } from '../../composables'
import { FlowInstance } from '../../types'
import { onLoadGetEdges, onLoadGetNodes, onLoadProject, onLoadToObject } from '../../utils'
import { onLoadGetEdges, onLoadGetElements, onLoadGetNodes, onLoadProject, onLoadToObject } from '../../utils'
const store = useStore()
store.isReady = true
nextTick(async () => {
store.isReady = true
// if ssr we can't wait for dimensions, they'll never really exist
const window = useWindow()
if ('screen' in window)
@@ -20,6 +20,7 @@ nextTick(async () => {
zoomTo,
setTransform,
project: onLoadProject(store),
getElements: onLoadGetElements(store),
getNodes: onLoadGetNodes(store),
getEdges: onLoadGetEdges(store),
toObject: onLoadToObject(store),