docs: added an upgrade guide for v1.10.0 (#4013)

* docs: added an upgrade guide for v1.10.0

* removed redis update command

* small text fix

* Update 1-10-0.md

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Shahed Nasser
2023-05-04 12:08:01 +03:00
committed by GitHub
parent 731f05d3e1
commit 98f70550cd
2 changed files with 57 additions and 31 deletions

View File

@@ -192,37 +192,6 @@ class CustomEventBus extends AbstractEventBusModuleService {
}
```
### (optional) retrieveSubscribers
This method is also implemented in the `AbstractEventBusModuleService` class. This section explains how you can override it to implement your custom logic, if necessary.
The `retrieveSubscribers` method is used to retrieve the subscribers to a specific event. If there are no subscribers to an event, the event is not stored in the database or processed by the event bus module.
The `retrieveSubscribers` method accepts one parameter, which is the name of the event. It should return an array of objects of the following type:
```ts
type SubscriberDescriptor = {
id: string
subscriber: Subscriber
}
```
Where:
- `id` is a string that is the ID of a subscriber.
- `subscriber` is a subscriber class.
For example, here's how the `retrieveSubscribers` is implemented in the `AbstractEventBusModuleService`:
```ts title=services/event-bus-custom.ts
class CustomEventBus extends AbstractEventBusModuleService {
// ...
retrieveSubscribers(event: string | symbol) {
return this.eventToSubscribersMap_.get(event)
}
}
```
---
## Step 3: Export the Service