Skip to content

Commit bcb1765

Browse files
committed
fix: missing async await for state.evaluate promise
1 parent 7e018d6 commit bcb1765

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class Mini {
3333
this._initEntities()
3434
this._initializeGlobalVariables()
3535
Events.applyEvents()
36-
this.state.evaluate()
36+
await this.state.evaluate()
3737
this.observer.init()
3838
const endTime = performance.now()
3939
const executionTime = endTime - startTime

lib/state.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ export class State {
206206
this.attachVariableHelpers([varName], entityID)
207207
}
208208

209-
evaluate() {
209+
async evaluate() {
210210
const promises = []
211211

212212
Array.from(this.entities.values()).forEach((entity) => {
213213
promises.push(entity.attributes.evaluate())
214214
})
215215

216216
await Promise.all(promises)
217-
217+
218218
this.attachVariableHelpers(Array.from(this.variables.keys()))
219219
this.shouldUpdate = true
220220
}

0 commit comments

Comments
 (0)