Examples
import { Query, World, optional } from '@wimaengine/ecs'
class Position {}
class Velocity {}
const world = new World()
world.spawn([new Position()])
const query = new Query(world, [Position, Velocity], [optional(Velocity)])
query.each(([position, velocity]) => {
// `velocity` is undefined when the entity has no Velocity component.
})