Add topic publishing sidebar
This commit is contained in:
@@ -46,7 +46,6 @@ class IpcRendererEventBus implements EventBusInterface {
|
||||
}
|
||||
|
||||
public emit<MessageType>(event: Event<MessageType>, msg: MessageType) {
|
||||
console.log(event.topic, msg)
|
||||
this.ipc.send(event.topic, msg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function makeConnectionStateEvent(connectionId: string): Event<DataSource
|
||||
}
|
||||
}
|
||||
|
||||
interface Message {
|
||||
export interface Message {
|
||||
topic: string,
|
||||
payload: any
|
||||
}
|
||||
@@ -33,3 +33,9 @@ export function makeConnectionMessageEvent(connectionId: string): Event<Message>
|
||||
topic: `conn/${connectionId}`,
|
||||
}
|
||||
}
|
||||
|
||||
export function makePublishEvent(connectionId: string): Event<Message> {
|
||||
return {
|
||||
topic: `conn/publish/${connectionId}`,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user