onTraitChange
onTraitChange(
world,trait,listener): () =>void
Koota’s world.onChange, which also takes a predicted or a core trait:
calls listener with each entity whose record of trait is set, and
returns the call that stops it. A HUD hears a player’s connection drop
with onTraitChange(world, ConnectionTrait, notify).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
trait |
PredictedTrait<any> | Trait | CoreTrait<any> |
listener |
(entity) => void |
Returns
Section titled “Returns”() => void