mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-17 01:56:27 +08:00
chore: merge blocksuite source code (#9213)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { Awareness } from 'y-protocols/awareness';
|
||||
|
||||
import type { AwarenessSource } from './source.js';
|
||||
|
||||
export class AwarenessEngine {
|
||||
constructor(
|
||||
readonly awareness: Awareness,
|
||||
readonly sources: AwarenessSource[]
|
||||
) {}
|
||||
|
||||
connect() {
|
||||
this.sources.forEach(source => source.connect(this.awareness));
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.sources.forEach(source => source.disconnect());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user