experiments(dui3): adds an event emitter base class

This commit is contained in:
Dimitrie Stefanescu
2023-07-11 19:17:22 +01:00
parent 2cdc5b7d92
commit ca91ff8960
+1
View File
@@ -17,6 +17,7 @@ export class BaseBridge {
return this.emitter.on(event, callback)
}
// NOTE: this could be private - as it should be only used by the host application.
emit(eventName: string, payload: string) {
const parsedPayload = JSON.parse(payload) as unknown
this.emitter.emit(eventName, parsedPayload)