mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
feat(infra): framework
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export interface AwarenessConnection {
|
||||
connect(): void;
|
||||
disconnect(): void;
|
||||
}
|
||||
|
||||
export class AwarenessEngine {
|
||||
constructor(public readonly connections: AwarenessConnection[]) {}
|
||||
|
||||
connect() {
|
||||
this.connections.forEach(connection => connection.connect());
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.connections.forEach(connection => connection.disconnect());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user