@expressive/mvc 0.43.1 → 0.43.3
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/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/index.mjs +6 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare namespace Model {
|
|
|
7
7
|
* Model constructor callback - is called when Model finishes intializing.
|
|
8
8
|
* Returned function will call when model is destroyed.
|
|
9
9
|
*/
|
|
10
|
-
type Callback<T extends Model = Model> = (this: T, thisArg: T) => (() => void) | Assign<T> | void;
|
|
10
|
+
type Callback<T extends Model = Model> = (this: T, thisArg: T) => (() => void) | Assign<T> | Promise<void> | void;
|
|
11
11
|
/** Model constructor argument */
|
|
12
12
|
type Argument<T extends Model = Model> = string | Callback<T> | Assign<T> | undefined;
|
|
13
13
|
/** Subset of `keyof T` which are not methods or defined by base Model U. **/
|
package/dist/index.js
CHANGED
|
@@ -172,7 +172,12 @@ var Model = class _Model {
|
|
|
172
172
|
}
|
|
173
173
|
addListener(this, () => {
|
|
174
174
|
const apply = typeof arg == "function" ? arg.call(this, this) : arg;
|
|
175
|
-
if (
|
|
175
|
+
if (apply instanceof Promise)
|
|
176
|
+
apply.catch((err) => {
|
|
177
|
+
console.error(`Async error in constructor for ${this}:`);
|
|
178
|
+
console.error(err);
|
|
179
|
+
});
|
|
180
|
+
else if (typeof apply == "object")
|
|
176
181
|
assign(this, apply);
|
|
177
182
|
for (const key in this) {
|
|
178
183
|
const desc = Object.getOwnPropertyDescriptor(this, key);
|
package/dist/index.mjs
CHANGED
|
@@ -138,7 +138,12 @@ var Model = class _Model {
|
|
|
138
138
|
}
|
|
139
139
|
addListener(this, () => {
|
|
140
140
|
const apply = typeof arg == "function" ? arg.call(this, this) : arg;
|
|
141
|
-
if (
|
|
141
|
+
if (apply instanceof Promise)
|
|
142
|
+
apply.catch((err) => {
|
|
143
|
+
console.error(`Async error in constructor for ${this}:`);
|
|
144
|
+
console.error(err);
|
|
145
|
+
});
|
|
146
|
+
else if (typeof apply == "object")
|
|
142
147
|
assign(this, apply);
|
|
143
148
|
for (const key in this) {
|
|
144
149
|
const desc = Object.getOwnPropertyDescriptor(this, key);
|
package/package.json
CHANGED