mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 03:19:52 +08:00
feat(core): new worker workspace engine (#9257)
This commit is contained in:
@@ -134,7 +134,9 @@ export abstract class AutoMessageHandler {
|
||||
private listening = false;
|
||||
protected abstract handlers: Partial<MessageHandlers>;
|
||||
|
||||
constructor(protected readonly port: MessageCommunicapable) {}
|
||||
constructor(protected readonly port: MessageCommunicapable) {
|
||||
this.listen();
|
||||
}
|
||||
|
||||
protected handleMessage = ignoreUnknownEvent((msg: Messages) => {
|
||||
const handler = this.handlers[msg.type];
|
||||
@@ -145,7 +147,7 @@ export abstract class AutoMessageHandler {
|
||||
handler(msg as any);
|
||||
});
|
||||
|
||||
listen() {
|
||||
protected listen() {
|
||||
if (this.listening) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user