Skip to content

refactor: use EventEmitter or EventTarget #1295

@justinmk3

Description

@justinmk3

Problem

We have code that is reimplementing the EventEmitter concept:

private async notifyDidChangeConfigurationListeners(): Promise<void> {
this.logging.debug('Notifying did change configuration listeners')
const updatedConfig = this.configurationCache.getConfig()
const listenPromises = Array.from(this.handleDidChangeConfigurationListeners, async listener => {
try {
await listener(updatedConfig)
} catch (error) {
this.logging.error(`Error occured in did change configuration listener: ${error}`)
}
})
await Promise.allSettled(listenPromises)
}

Expected behavior

replace all such code with EventEmitter or EventTarget (web compatible)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions