File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,14 @@ export class State {
79
79
80
80
addVariable ( variable , entityID ) {
81
81
const variables = this . variables . get ( variable ) || [ ]
82
+ if ( variables . includes ( entityID ) ) return
82
83
this . variables . set ( variable , [ ...variables , entityID ] )
83
84
}
84
85
85
86
addEntityVariable ( groupID , variable , entityID ) {
86
87
const key = `${ groupID } .${ variable } `
87
88
const variables = this . entityVariables . get ( key ) || [ ]
89
+ if ( variables . includes ( entityID ) ) return
88
90
this . entityVariables . set ( key , [ ...variables , entityID ] )
89
91
}
90
92
@@ -205,10 +207,14 @@ export class State {
205
207
}
206
208
207
209
evaluate ( ) {
208
- Array . from ( this . entities . values ( ) ) . forEach ( async ( entity ) => {
209
- entity . attributes . evaluate ( )
210
+ const promises = [ ]
211
+
212
+ Array . from ( this . entities . values ( ) ) . forEach ( ( entity ) => {
213
+ promises . push ( entity . attributes . evaluate ( ) )
210
214
} )
211
215
216
+ await Promise . all ( promises )
217
+
212
218
this . attachVariableHelpers ( Array . from ( this . variables . keys ( ) ) )
213
219
this . shouldUpdate = true
214
220
}
You can’t perform that action at this time.
0 commit comments