mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Change onBeforeRun API (#3981)
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
58f7bcb38d
commit
724b9450a6
4 files changed
+82
-59
No files matched your search
@@ -51,13 +51,15 @@ export class CatalogEntityRegistry {
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a onBeforeRun hook to a catalog entity. If `onBeforeRun` was previously added then it will not be added again
|
||||
* @param catalogEntityUid The uid of the catalog entity
|
||||
* @param onBeforeRun The function that should return a boolean if the onRun of catalog entity should be triggered.
|
||||
* Add a onBeforeRun hook to a catalog entities. If `onBeforeRun` was previously
|
||||
* added then it will not be added again.
|
||||
* @param onBeforeRun The function to be called with a `CatalogRunEvent`
|
||||
* event target will be the catalog entity. onBeforeRun hook can call event.preventDefault()
|
||||
* to stop run sequence
|
||||
* @returns A function to remove that hook
|
||||
*/
|
||||
addOnBeforeRun(entity: CatalogEntity, onBeforeRun: CatalogEntityOnBeforeRun): Disposer {
|
||||
return registry.addOnBeforeRun(entity, onBeforeRun);
|
||||
addOnBeforeRun(onBeforeRun: CatalogEntityOnBeforeRun): Disposer {
|
||||
return registry.addOnBeforeRun(onBeforeRun);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user