fallback to Symbol

This commit is contained in:
Niels Lyngsø
2023-07-06 10:47:10 +02:00
parent 48836422db
commit bac1c6065b

View File

@@ -53,7 +53,7 @@ export const UmbClassMixin = <T extends ClassConstructor>(superClass: T) => {
constructor(host: UmbControllerHost, controllerAlias: UmbControllerAlias) {
super();
this._host = host;
this._controllerAlias = controllerAlias ?? undefined; // ?? Symbol();
this._controllerAlias = controllerAlias ?? Symbol(); // This will fallback to a Symbol, ensuring that this class is only appended to the controller host once.
}
getHostElement(): EventTarget {