-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
I found two issues while working with queries
updateEach callback doesn't include components with modifiers (Added, Destroyed, Changed) in the query, even though they are present during runtime:
world.query(Added(Foo)).updateEach(([foo]) => {
// Typescript says foo is undefined here, but it's Foo
})
world.query(Added(Foo), Bar).updateEach(([foo, bar]) => {
// Typescript says foo is Bar here and that bar is undefined
})
Calling updateEach on two identical queries where the order of components differ will cause the second query to get the previous queries sorting:
world.query(Player, Health).updateEach(([player, health], entity) => {
})
world.query(Health, Player).updateEach(([health, player], entity) => {
// player here is Health, and health is Player.
})
Codesandbox: https://codesandbox.io/p/sandbox/lwkk8q
chamchi0809 and markhughes
Metadata
Metadata
Assignees
Labels
No labels