From 5c2f15061ebb3d6bc3943328abb3b0451d6baa39 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 30 May 2024 19:32:14 +0200 Subject: [PATCH] refactor(core): replace array map --- packages/core/src/utils/storage.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/core/src/utils/storage.ts b/packages/core/src/utils/storage.ts index a2957518..9895d824 100644 --- a/packages/core/src/utils/storage.ts +++ b/packages/core/src/utils/storage.ts @@ -57,8 +57,23 @@ export class Storage { } // for lookup purposes - const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id)) - const edgeIds = computed(() => reactiveState.edges.map((e) => e.id)) + const nodeIds = computed(() => { + const ids: string[] = [] + for (const node of reactiveState.nodes) { + ids.push(node.id) + } + + return ids + }) + + const edgeIds = computed(() => { + const ids: string[] = [] + for (const edge of reactiveState.edges) { + ids.push(edge.id) + } + + return ids + }) const getters = useGetters(reactiveState, nodeIds, edgeIds)