From f386bab02eff654694c85ccb826d80df91c4e471 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Mar 2023 11:10:16 +0100 Subject: Add ability for plugins to add metadata --- client/src/app/core/plugins/hooks.service.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'client/src') diff --git a/client/src/app/core/plugins/hooks.service.ts b/client/src/app/core/plugins/hooks.service.ts index d9fef8389..978316ec2 100644 --- a/client/src/app/core/plugins/hooks.service.ts +++ b/client/src/app/core/plugins/hooks.service.ts @@ -48,6 +48,15 @@ export class HooksService { return this.pluginService.runHook(hookResultName, result, params) } + async wrapFunResult + (fun: RawFunction, params: P, scope: PluginClientScope, hookResultName: H) { + await this.pluginService.ensurePluginsAreLoaded(scope) + + const result = fun(params) + + return this.pluginService.runHook(hookResultName, result, params) + } + runAction (hookName: U, scope: PluginClientScope, params?: T) { // Use setTimeout to give priority to Angular change detector setTimeout(() => { -- cgit v1.2.3