readEach
Call Signature
Section titled “Call Signature”readEach<
T>(world,query,callback):void
Calls callback for each entity query matches, in the order
world.query lists them, as koota’s readEach does, building no
array and no record: koota’s builds both on every call, which is most
of a frame’s garbage. A trait of fields is handed as a record the pass
reuses, so a callback keeps a field and never the record.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends QueryParameter[] |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
query |
Query<T> |
callback |
EachCallback<T> |
Returns
Section titled “Returns”void
Call Signature
Section titled “Call Signature”readEach<
T>(world,predictedQuery,callback):void
As readEach over koota’s query, over the engine’s query of a
predicted trait, whose record it hands read-only.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends EngineQueryParameter[] |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
predictedQuery |
PredictedQuery<T> |
callback |
(traits, entity, index) => void |
Returns
Section titled “Returns”void