Eventrix was created to facilitate state management in frontend applications.
Communication between elements
The assumption of the library is to enable easy state management in the application as well as communication between its elements without using state.
The ability to create generic functionalities that can communicate with each other in a way that does not depend. Thanks to this solution, we can create an application that is resistant to errors in its other elements.
Adapter for redux to replace redux with eventrix in simple applications that do not use additional redux libraries.
Sa universal tool for both small (simple) projects and larger solutions consisting of several dozen modules and project services, it is a scalable solution. precise condition management.
Greater control of data flow thanks to additional tools (devtools) and a small threshold of entry (small amount of code to write).
The entire architecture is based on 4 elements
- State - a global state of an application managed by stateManager in the instance of Eventri,. StateManager emits events about the change of a state.
- Receiver - a receiver of events that can modify the state thanks to access to stateManager after registering it in the instance of Eventrix
- Listener - scans for events in the instance of Eventrix in order to perform other actions
- Emitter - emits events through the instance of Eventrix
These elements allow for communication between services and components in an app. According to the main assumption, services are supposed to register their receivers that would be responsible for receiving data from the server and transferring them to the global state. It is obvious that a receiver activates when it records an event that it is scanning for. Components should be tasked with emitting events and scanning for changes of the state as well as other emitted events.