feat(core, event-bus): Compensate emit event step utility (#13281)

* feat(core, event-bus): Compensate emit event step utility

* tests

* Update changeset to remove integration-tests-modules

Removed integration-tests-modules from changeset.

* revert test script
This commit is contained in:
Adrien de Peretti
2025-08-25 15:08:09 +02:00
committed by GitHub
parent 73a25abecb
commit fc49253273
11 changed files with 547 additions and 22 deletions
@@ -130,8 +130,19 @@ export default class LocalEventBusService extends AbstractEventBusModuleService
await this.clearGroupedEvents(eventGroupId)
}
async clearGroupedEvents(eventGroupId: string) {
this.groupedEventsMap_.delete(eventGroupId)
async clearGroupedEvents(
eventGroupId: string,
{ eventNames }: { eventNames?: string[] } = {}
) {
if (eventNames?.length) {
const groupedEvents = this.groupedEventsMap_.get(eventGroupId) || []
const eventsToKeep = groupedEvents.filter(
(event) => !eventNames!.includes(event.name)
)
this.groupedEventsMap_.set(eventGroupId, eventsToKeep)
} else {
this.groupedEventsMap_.delete(eventGroupId)
}
}
subscribe(