Eventrix
Method | attributes | description |
constructor | initialState, eventsReceivers | Eventrix class constructor |
listen | eventName, listener | Add event listener |
unlisten | eventName, listener | Remove event listener |
emit | eventName, eventData | Emit event for eventrix instance it will run listeners and events receivers |
getState | path | Get eventrix state |
useReceiver | eventsReceiver | Register events receiver in eventrix instance it will be used on events emitted |
removeReceiver | eventsReceiver | Unregister events receiver from eventrix instance |
getParent | - | Get parent eventrix instance |
getFirstParent | - | Get first parent eventrix instance |
create | scopes | Create eventrix instance with scopes |
onError | errorCallback | callback function to catch errors in receivers and listeners called on emit events |
Example of simple use of Eventrix
When You emit event with name "createUserEventName" usersEventsReceiver will be invoked and change state of "usersList".
Last updated