Commit a3ad6d09 authored by nanahira's avatar nanahira

return promise of inner plugin

parent 07760214
...@@ -108,11 +108,12 @@ export namespace DoRegister { ...@@ -108,11 +108,12 @@ export namespace DoRegister {
export const plugin = registry.define('plugin', (_, ctx, obj, key) => { export const plugin = registry.define('plugin', (_, ctx, obj, key) => {
const pluginDescMayBeProm: Awaitable<PluginDefinition<any>> = obj[key](); const pluginDescMayBeProm: Awaitable<PluginDefinition<any>> = obj[key]();
if (pluginDescMayBeProm instanceof Promise) { if (pluginDescMayBeProm instanceof Promise) {
pluginDescMayBeProm.then((pluginDef) => { return pluginDescMayBeProm.then((pluginDef) => {
applyInnerPluginDef(ctx, key, pluginDef); applyInnerPluginDef(ctx, key, pluginDef);
}); });
} else { } else {
applyInnerPluginDef(ctx, key, pluginDescMayBeProm); applyInnerPluginDef(ctx, key, pluginDescMayBeProm);
return;
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment