mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 11:15:23 -04:00
docs: Move 'Events' to design docs
Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
58f306a38c
commit
3c957e9b0e
2 changed files with 7 additions and 2 deletions
13
docs/content/dev/design_docs/events.md
Normal file
13
docs/content/dev/design_docs/events.md
Normal file
|
@ -0,0 +1,13 @@
|
|||
# Events
|
||||
|
||||
In HedgeDoc 2, we use an event system based on [EventEmitter2][eventemitter2].
|
||||
It's used to reduce circular dependencies between different services and inform these services about changes.
|
||||
|
||||
HedgeDoc's system is basically [the system NestJS offers][nestjs/eventemitter].
|
||||
The config for the `EventEmitterModule` is stored in `events.ts` and exported as `eventModuleConfig`.
|
||||
In the same file enums for the event keys are defined. Each of these events is expected to be sent with an additional value.
|
||||
In the enum definition a comment should tell you what exactly this value should be.
|
||||
|
||||
[eventemitter2]: https://github.com/EventEmitter2/EventEmitter2
|
||||
[nestjs/eventemitter]: https://docs.nestjs.com/techniques/events
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue