adding repository notes

This commit is contained in:
Niels Lyngsø
2023-01-27 11:34:06 +01:00
parent 7f8e2cc432
commit 3b7e0856eb

View File

@@ -7,7 +7,15 @@ import { appendToFrozenArray } from '@umbraco-cms/observable-api';
export class UmbDocumentWorkspaceContext extends UmbWorkspaceContext implements UmbWorkspaceEntityContextInterface<DocumentDetails | undefined> {
// Repository notes:
/*
#draft = new ObjectState<Type | undefined>(undefined);
*/
// Manager will be removed when we get the Repository:
#manager = new UmbEntityWorkspaceManager(this._host, 'document', UMB_DOCUMENT_DETAIL_STORE_CONTEXT_TOKEN);
public readonly data = this.#manager.state.asObservable();
@@ -26,6 +34,23 @@ export class UmbDocumentWorkspaceContext extends UmbWorkspaceContext implements
save = this.#manager.save;
destroy = this.#manager.destroy;
/**
* Concept for Repository impl.:
load(entityKey: string) {
this.#repository.load(entityKey).then((data) => {
this.#draft.next(data)
})
}
create(parentKey: string | undefined) {
this.#repository.create(parentKey).then((data) => {
this.#draft.next(data)
})
}
*/
// This could eventually be moved out as well?
setPropertyValue(alias: string, value: unknown) {