I have implemented Observers for moecs.
Observers are a mechanism that allows to subscribe on events of structural and data changes in the world. By default observers are disable for performance reasons, so you need to pass true for observable argument of new_world procedure when you create the world. You also can change observable property of the world to turn off/on observers globally.
There are different event types that can be handled for entities, components, and tags.
| Event | Description |
|---|---|
| SPAWNED | Entity has been spawned. |
| DESPAWNED | Entity has been despawned. |