You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want {to add custom hooks that run before or after blocks}
So that {I can enrich Jayvee without modifying the original source code}
User Acceptance Criteria
Users of the Jayvee lib can add hooks to all blocks
Users of the Jayvee lib can add hooks to individual blocks (not in the first version)
Users of the Jayvee lib can add hooks to whole pipelines / programs (not in the first version)
The number of hooks per blocks is not limited
A hook is basically a function that is called when due.
It can be blocking or non-blocking. It's a user's choice. Default: non-blocking
It can be asynchronous (important detail for blocking functions).
If it's a pre-block hook: It retrieves the input parameters of a block (i.e. metadata and data).
If it's a post-block hook: It retrieves the input and output parameters of a block (i.e. metadata and input data and output data).
In this first version, there is no option to alter the input or output data or metadata.
Examples
I can imaging that we can use it like that:
constmyJayveeProgram=// ...;myJayveeProgram.addPreBlockHook(async({args, input})=>{console.log(args);// type `unknown`? For now at leastconsole.log(input);// type `unknown`? For now at least},{blocking: true,});myJayveeProgram.execute();
Notes
No support is needed for:
Removing hooks
Definitions of Done
A PR has been opened and accepted
All user acceptance criteria are met
All tests are passing
The text was updated successfully, but these errors were encountered:
@TungstnBallon This is a first version for the hooks. There is not much options available for this first draft of the hooks, more advanced feature will come in follow up issues.
User Story
User Acceptance Criteria
Users of the Jayvee lib can add hooks to individual blocks(not in the first version)Users of the Jayvee lib can add hooks to whole pipelines / programs(not in the first version)A hook is basically a function that is called when due.
Examples
I can imaging that we can use it like that:
Notes
No support is needed for:
Definitions of Done
The text was updated successfully, but these errors were encountered: