mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 03:26:47 +08:00
feat: add MessageCenterHandler (#770)
Co-authored-by: Peng Xiao <pengxiao@freewheel.tv>
This commit is contained in:
@@ -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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user