diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection.context.ts b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection.context.ts index 1790e04de1..23fa34990f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/collection/collection.context.ts @@ -32,12 +32,6 @@ export class UmbCollectionContext k !== id); } - // TODO: how can we make sure to call this. - public destroy(): void { - this.#items.unsubscribe(); - } - public getEntityType() { return this._entityType; } - /* - public getData() { - return this.#data.getValue(); - } - */ - - /* - public update(data: Partial) { - this._data.next({ ...this.getData(), ...data }); - } - */ - - // protected _onStoreSubscription(): void { - // if (!this._store) { - // return; - // } - - // this._dataObserver?.destroy(); - - // if (this._entityId) { - // this._dataObserver = new UmbObserverController( - // this._host, - // this._store.getTreeItemChildren(this._entityId), - // (nodes) => { - // if (nodes) { - // this.#data.next(nodes); - // } - // } - // ); - // } else { - // this._dataObserver = new UmbObserverController(this._host, this._store.getTreeRoot(), (nodes) => { - // if (nodes) { - // this.#data.next(nodes); - // } - // }); - // } - // } - protected async _onRepositoryReady() { if (!this.repository) return; this.requestCollection(); @@ -143,11 +94,15 @@ export class UmbCollectionContext) { this.#filter.next({ ...this.#filter.getValue(), ...filter }); this.requestCollection(); } + + // TODO: how can we make sure to call this. + public destroy(): void { + this.#items.unsubscribe(); + } } export const UMB_COLLECTION_CONTEXT = new UmbContextToken>('UmbCollectionContext');