feat(editor): add loaded and disposed hook for store extension (#10669)

This commit is contained in:
Saul-Mirone
2025-03-06 13:31:09 +00:00
parent e02fb4fa94
commit 8d10b40b72
3 changed files with 12 additions and 5 deletions
@@ -2,7 +2,6 @@ import { BlockSuiteError, ErrorCode } from '@blocksuite/global/exceptions';
import { Slot } from '@blocksuite/global/slot';
import { computed, signal } from '@preact/signals-core';
import type { Store } from '../../model';
import { nanoid } from '../../utils/id-generator';
import type { StackItem } from '../../yjs';
import { StoreExtension } from '../store-extension';
@@ -47,9 +46,7 @@ export class StoreSelectionExtension extends StoreExtension {
remoteChanged: new Slot<Map<number, BaseSelection[]>>(),
};
constructor(store: Store) {
super(store);
override loaded() {
this.store.provider.getAll(SelectionIdentifier).forEach(ctor => {
[ctor].flat().forEach(ctor => {
this._selectionConstructors[ctor.type] = ctor;