@brandup/ui 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/mjs/index.js +4 -2
- package/dist/mjs/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -128,7 +128,7 @@ class UIElement {
|
|
|
128
128
|
return true;
|
|
129
129
|
}
|
|
130
130
|
onDestroy(callback) {
|
|
131
|
-
if (!this.__element)
|
|
131
|
+
if (!this.__element || !callback)
|
|
132
132
|
return;
|
|
133
133
|
if (!this.__destroyCallbacks)
|
|
134
134
|
this.__destroyCallbacks = [];
|
|
@@ -136,8 +136,10 @@ class UIElement {
|
|
|
136
136
|
this.__destroyCallbacks.push(() => callback.destroy());
|
|
137
137
|
else if (callback instanceof Element)
|
|
138
138
|
this.__destroyCallbacks.push(() => callback.remove());
|
|
139
|
-
else
|
|
139
|
+
else if (typeof callback === "function")
|
|
140
140
|
this.__destroyCallbacks.push(callback);
|
|
141
|
+
else
|
|
142
|
+
throw new Error("Unsupported callback type.");
|
|
141
143
|
}
|
|
142
144
|
toString() {
|
|
143
145
|
return this.typeName;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/mjs/index.js
CHANGED
|
@@ -126,7 +126,7 @@ class UIElement {
|
|
|
126
126
|
return true;
|
|
127
127
|
}
|
|
128
128
|
onDestroy(callback) {
|
|
129
|
-
if (!this.__element)
|
|
129
|
+
if (!this.__element || !callback)
|
|
130
130
|
return;
|
|
131
131
|
if (!this.__destroyCallbacks)
|
|
132
132
|
this.__destroyCallbacks = [];
|
|
@@ -134,8 +134,10 @@ class UIElement {
|
|
|
134
134
|
this.__destroyCallbacks.push(() => callback.destroy());
|
|
135
135
|
else if (callback instanceof Element)
|
|
136
136
|
this.__destroyCallbacks.push(() => callback.remove());
|
|
137
|
-
else
|
|
137
|
+
else if (typeof callback === "function")
|
|
138
138
|
this.__destroyCallbacks.push(callback);
|
|
139
|
+
else
|
|
140
|
+
throw new Error("Unsupported callback type.");
|
|
139
141
|
}
|
|
140
142
|
toString() {
|
|
141
143
|
return this.typeName;
|
package/dist/mjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|