mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Support multiple onBeforeHooks per entity
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
c8631346ca
commit
44a8824635
6 files changed
+74
-111
No files matched your search
@@ -55,15 +55,15 @@ export class CatalogEntityRegistry {
|
||||
* @param onBeforeRun The function that should return a boolean if the onBeforeRun of catalog entity should be triggered.
|
||||
* @returns A function to remove that hook
|
||||
*/
|
||||
addOnBeforeRun(catalogEntityUid: CatalogEntity["metadata"]["uid"], onBeforeRun: CatalogEntityOnBeforeRun) {
|
||||
return registry.addOnBeforeRun(catalogEntityUid, onBeforeRun);
|
||||
addOnBeforeRun(entity: CatalogEntity, onBeforeRun: CatalogEntityOnBeforeRun) {
|
||||
return registry.addOnBeforeRun(entity, onBeforeRun);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns one catalog entity onBeforeRun by catalog entity uid
|
||||
*/
|
||||
onBeforeRun(catalogEntityUid: CatalogEntity["metadata"]["uid"]): CatalogEntityOnBeforeRun | undefined {
|
||||
return registry.getOnBeforeRun(catalogEntityUid);
|
||||
onBeforeRun(entity: CatalogEntity): Promise<boolean> {
|
||||
return registry.onBeforeRun(entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user