Skip to content

Commit 5c2f150

Browse files
committed
refactor(core): replace array map
1 parent dc3ef70 commit 5c2f150

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

packages/core/src/utils/storage.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,23 @@ export class Storage {
5757
}
5858

5959
// for lookup purposes
60-
const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id))
61-
const edgeIds = computed(() => reactiveState.edges.map((e) => e.id))
60+
const nodeIds = computed(() => {
61+
const ids: string[] = []
62+
for (const node of reactiveState.nodes) {
63+
ids.push(node.id)
64+
}
65+
66+
return ids
67+
})
68+
69+
const edgeIds = computed(() => {
70+
const ids: string[] = []
71+
for (const edge of reactiveState.edges) {
72+
ids.push(edge.id)
73+
}
74+
75+
return ids
76+
})
6277

6378
const getters = useGetters(reactiveState, nodeIds, edgeIds)
6479

0 commit comments

Comments
 (0)