0.1.1 • Published 7 years ago
@cyber4all/service-messager v0.1.1
CLARK Service Messager
Usage
When needing to dispatch an event to any listeners, the static dispatch method can be used. The event property is given an enum value, and the payload can contain any data pertaining to the event.
EventDispatcher.dispatch({
event: /* SYSTEM_EVENT.<Event> */,
payload: { /* Payload contents ... */ },
});
Adding an Event Type
To add a new type of event to the system, a pull request should be opened here to add the value to the SYSTEM_EVENT enum. This will keep event classification consistant throughout each service in the system.