feat: add MessageCenterHandler (#770)

Co-authored-by: Peng Xiao <pengxiao@freewheel.tv>
This commit is contained in:
Qi
2023-02-17 11:02:10 +08:00
committed by GitHub
parent f68b4934c6
commit cc1323f5cc
7 changed files with 78 additions and 46 deletions
@@ -32,5 +32,8 @@ export class MessageCenter extends Observable<string> {
public onMessage(callback: (message: Message) => void) {
this.on('message', callback);
return () => {
this.off('message', callback);
};
}
}