1
0
Fork 0

Add ability for plugins to add metadata

This commit is contained in:
Chocobozzz 2023-03-10 11:10:16 +01:00
parent b34563079a
commit f386bab02e
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -48,6 +48,15 @@ export class HooksService {
return this.pluginService.runHook(hookResultName, result, params)
}
async wrapFunResult <P, R, H extends ClientFilterHookName>
(fun: RawFunction<P, R>, params: P, scope: PluginClientScope, hookResultName: H) {
await this.pluginService.ensurePluginsAreLoaded(scope)
const result = fun(params)
return this.pluginService.runHook(hookResultName, result, params)
}
runAction<T, U extends ClientActionHookName> (hookName: U, scope: PluginClientScope, params?: T) {
// Use setTimeout to give priority to Angular change detector
setTimeout(() => {