mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
feat(core): add actions to editor settings (#8030)
# What Changed? - Add actions of following edgeless-elements editor settings: - note - connector - edgeless text - pen
This commit is contained in:
@@ -4,8 +4,11 @@ import type { FrameworkProvider } from '../provider';
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export class Component<Props = {}> {
|
||||
readonly framework: FrameworkProvider;
|
||||
|
||||
readonly props: Props;
|
||||
|
||||
protected readonly disposables: (() => void)[] = [];
|
||||
|
||||
get eventBus() {
|
||||
return this.framework.eventBus;
|
||||
}
|
||||
@@ -19,7 +22,9 @@ export class Component<Props = {}> {
|
||||
CONSTRUCTOR_CONTEXT.current = {};
|
||||
}
|
||||
|
||||
dispose() {}
|
||||
dispose() {
|
||||
this.disposables.forEach(dispose => dispose());
|
||||
}
|
||||
|
||||
[Symbol.dispose]() {
|
||||
this.dispose();
|
||||
|
||||
Reference in New Issue
Block a user