experiments(dui3): adds an event emitter base class
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user