perf(core): replace Array.forEach loops
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -285,7 +285,7 @@ export function useWatchProps(
|
||||
'autoConnect',
|
||||
]
|
||||
|
||||
Object.keys(props).forEach((key) => {
|
||||
for (const key of Object.keys(props)) {
|
||||
const propKey = key as keyof typeof props
|
||||
if (!skip.includes(propKey)) {
|
||||
const propValue = toRef(() => props[propKey])
|
||||
@@ -306,7 +306,7 @@ export function useWatchProps(
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const runAll = () => {
|
||||
|
||||
Reference in New Issue
Block a user