notes for next week

This commit is contained in:
Niels Lyngsø
2023-01-06 20:48:02 +01:00
parent ed264b237d
commit 13c5fd8423
2 changed files with 14 additions and 0 deletions

View File

@@ -40,11 +40,22 @@ export class UmbWorkspaceViewContentEditElement extends UmbLitElement {
private _observeContent() {
if (!this._workspaceContext) return;
/*
TODO: Property-Context: This observer gets all changes, We need to fix this. it should be simpler.
It should look at length and aliases? as long as they are identical nothing should change.
As they would update them selfs?
Should use a Observable for this._workspaceContext.properties
*/
this.observe(
this._workspaceContext.data.pipe(distinctUntilChanged()),
(content) => {
this._properties = content.properties;
this._data = content.data;
/*
Maybe we should not give the value, but the umb-content-property should get the context and observe its own data.
This would become a more specific Observer therefor better performance?.. Note to self: Debate with Mads how he sees this perspective.
*/
}
);
}

View File

@@ -41,6 +41,9 @@ export class UmbWorkspaceContentContext<
) {
this._host = host;
//TODO: Use the UniqueBehaviorSubject, and separate observables for each part?
this._data = new BehaviorSubject<ContentTypeType>(defaultData);
this.data = this._data.asObservable();
this.entityType = entityType;