partey_workadventure/front/src/WebRtc/DiscussionManager.ts
2021-07-07 18:07:58 +02:00

14 lines
468 B
TypeScript

import { iframeListener } from "../Api/IframeListener";
import { chatMessagesStore, chatVisibilityStore } from "../Stores/ChatStore";
export class DiscussionManager {
constructor() {
iframeListener.chatStream.subscribe((chatEvent) => {
chatMessagesStore.addExternalMessage(parseInt(chatEvent.author), chatEvent.message);
chatVisibilityStore.set(true);
});
}
}
export const discussionManager = new DiscussionManager();