Skip to content

Kiln API / kiln / QueryView

Interface: QueryView<P> ​

The result of one named query inside system({ a: [...], b: [...] }, fn).

Extends ​

  • Iterable<Entity>

Type Parameters ​

Type ParameterDefault type
P extends QueryListQueryList

Properties ​

PropertyModifierTypeDescription
lengthreadonlynumberNumber of matching entities this run.
entitiesreadonlyreadonly Entity[]The matching entities. Do not keep this array across runs.

Methods ​

first() ​

ts
first(): Entity | undefined;

First matching entity, or undefined.

Returns ​

Entity | undefined


forEach() ​

ts
forEach(fn): void;

Calls fn for every matching entity.

Parameters ​

ParameterType
fn(entity, index) => void

Returns ​

void


each() ​

ts
each(fn): void;

Like the per-entity system form: rows honour Mut() and read-only access.

Parameters ​

ParameterType
fn(row, entity) => void

Returns ​

void