iacobson / ecspanse

Entity Component System (ECS) library for Elixir, offering a suite of features including: flexible queries with multiple filters, dynamic bidirectional relationships, versatile tagging capabilities, system event subscriptions, or asynchronous system execution.
https://hexdocs.pm/ecspanse
Apache License 2.0
63 stars 7 forks source link

Introduce Projections #7

Closed iacobson closed 1 year ago

iacobson commented 1 year ago

The idea of the Projections is to enhance communication with external systems (eg. Phoenix, Livebook, etc.).

The Projection is a GenServer that queries the Ecspanse components and returns a struct. The queries run every frame, and if any change in the struct state happens, an optional on_update callback is triggered.

The callback for example, can do a PubSub push to a LiveView.

The projections are complex models based on various component queries.