remove event listener
This commit is contained in:
@@ -103,6 +103,8 @@ export class UmbContextProvider<BaseType = unknown, ResultType extends BaseType
|
||||
|
||||
destroy(): void {
|
||||
this.hostDisconnected();
|
||||
// Note we are not removing the event listener in the hostDisconnected, therefor we do it here [NL].
|
||||
this.#eventTarget?.removeEventListener(UMB_CONTENT_REQUEST_EVENT_TYPE, this.#handleContextRequest);
|
||||
// We want to call a destroy method on the instance, if it has one.
|
||||
(this.#instance as any)?.destroy?.();
|
||||
this.#instance = undefined;
|
||||
|
||||
Reference in New Issue
Block a user