feat: seperate createDoc and createStore (#11182)

This commit is contained in:
Saul-Mirone
2025-03-26 11:03:47 +00:00
parent d6093e1d66
commit 0a8d8e0a6b
70 changed files with 337 additions and 312 deletions

View File

@@ -100,7 +100,9 @@ export class DocDisplayMetaService
return signal(DocDisplayMetaService.icons.deleted);
}
let icon$ = this.iconMap.get(doc);
const store = doc.getStore();
let icon$ = this.iconMap.get(store);
if (!icon$) {
icon$ = signal(
@@ -128,11 +130,11 @@ export class DocDisplayMetaService
this.disposables.splice(index, 1);
disposable.unsubscribe();
}
this.iconMap.delete(doc);
this.iconMap.delete(store);
}
});
this.disposables.push(docRemovedSubscription);
this.iconMap.set(doc, icon$);
this.iconMap.set(store, icon$);
}
return computed(() => {
@@ -165,7 +167,9 @@ export class DocDisplayMetaService
return signal(title || 'Deleted doc');
}
let title$ = this.titleMap.get(doc);
const store = doc.getStore();
let title$ = this.titleMap.get(store);
if (!title$) {
title$ = signal(doc.meta?.title || 'Untitled');
@@ -185,11 +189,11 @@ export class DocDisplayMetaService
this.disposables.splice(index, 1);
disposable.unsubscribe();
}
this.iconMap.delete(doc);
this.iconMap.delete(store);
}
});
this.disposables.push(docRemovedSubscription);
this.titleMap.set(doc, title$);
this.titleMap.set(store, title$);
}
return computed(() => {