mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-15 00:56:26 +08:00
feat: services
This commit is contained in:
@@ -97,14 +97,17 @@ export class AbstractBlock<
|
||||
}
|
||||
|
||||
public on(
|
||||
event: 'content' | 'children' | 'parent',
|
||||
event: 'cascade' | 'content' | 'children' | 'parent',
|
||||
name: string,
|
||||
callback: BlockListener
|
||||
) {
|
||||
this._listeners[event]?.set(name, callback);
|
||||
}
|
||||
|
||||
public off(event: 'content' | 'children' | 'parent', name: string) {
|
||||
public off(
|
||||
event: 'cascade' | 'content' | 'children' | 'parent',
|
||||
name: string
|
||||
) {
|
||||
this._listeners[event]?.delete(name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user