Event subsystem (for notifications)
PubSweet applications need a way to notify users when certain things occur. For example:
- Author receives an email when their manuscript is approved
- Editor receives a mobile push message when a manuscript is assigned to them
- Peer reviewer receives a desktop notification when a new message is posted in chat
- Staff dashboard updates to show a new manuscript via a GraphQL subscription
To this end we can create an event bus which receives events from server endpoints/mutations and allows other server components to listen to these and trigger notifications as they see fit.
It's likely that this will be useful beyond just notifications. For example an audit log will be easier to understand if it is structured around user events rather than database updates.