perf(core): replace Array.forEach loops

This commit is contained in:
braks
2024-02-05 07:51:12 +01:00
committed by Braks
parent 66d7198a2f
commit c4b4a04aa0
9 changed files with 57 additions and 42 deletions
+4 -4
View File
@@ -40,15 +40,15 @@ export class Storage {
const reactiveState = reactive(state)
const hooksOn = <any>{}
Object.entries(reactiveState.hooks).forEach(([n, h]) => {
for (const [n, h] of Object.entries(reactiveState.hooks)) {
const name = `on${n.charAt(0).toUpperCase() + n.slice(1)}`
hooksOn[name] = h.on
})
}
const emits = <any>{}
Object.entries(reactiveState.hooks).forEach(([n, h]) => {
for (const [n, h] of Object.entries(reactiveState.hooks)) {
emits[n] = h.trigger
})
}
// for lookup purposes
const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id))