We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0fe8ce8 commit 8717a66Copy full SHA for 8717a66
packages/core/Editor.ts
@@ -89,7 +89,9 @@ class Editor extends EventEmitter {
89
if (hook) {
90
this.hooksEntity[hookName].tapPromise(plugin.pluginName + hookName, function () {
91
// eslint-disable-next-line prefer-rest-params
92
- return hook.apply(plugin, [...arguments]);
+ const result = hook.apply(plugin, [...arguments]);
93
+ // hook 兼容非 Promise 返回值
94
+ return result instanceof Promise ? result : Promise.resolve(result);
95
});
96
}
97
0 commit comments