refactor(core): replace array map
This commit is contained in:
@@ -57,8 +57,23 @@ export class Storage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// for lookup purposes
|
// for lookup purposes
|
||||||
const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id))
|
const nodeIds = computed(() => {
|
||||||
const edgeIds = computed(() => reactiveState.edges.map((e) => e.id))
|
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)
|
const getters = useGetters(reactiveState, nodeIds, edgeIds)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user