@lvce-editor/api 8.55.0 → 8.56.0
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.
|
@@ -470,7 +470,14 @@ export const dispatchViewEvent = async (uid, event) => {
|
|
|
470
470
|
const instanceUids = instanceUidsByView[contextViewIds[uid]];
|
|
471
471
|
instanceUids.delete(uid);
|
|
472
472
|
instanceUids.add(uid);
|
|
473
|
-
if (
|
|
473
|
+
if (event.handler) {
|
|
474
|
+
const handler = instance[event.handler];
|
|
475
|
+
if (typeof handler !== 'function') {
|
|
476
|
+
throw new TypeError(`view event handler ${event.handler} is not a function`);
|
|
477
|
+
}
|
|
478
|
+
await Reflect.apply(handler, instance, event.args || []);
|
|
479
|
+
}
|
|
480
|
+
else if (typeof instance.handleEvent === 'function') {
|
|
474
481
|
await instance.handleEvent(event);
|
|
475
482
|
}
|
|
476
483
|
const result = await renderPatches(uid, instance);
|