We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hookable hooks will be called sequentially by default with original arguments. But result of each step is not preserved.
We could export a built-in chainable hook runner.
Example from unjs/community#15 (@ChrisGV04)
const chainableCaller = async (hooks, args) => { let hookResult: Order = args[0]; for (const hook of hooks) { hookResult = await hook(hookResult); } return hookResult; } /** Before create hook */ const orderData = await hooks.callHookWith(chainableCaller, 'orders:before-create', originalOrder);
Some ideas:
chainableCaller
hookable.callHookChained(name, <initial>)
The text was updated successfully, but these errors were encountered:
I like your preferred proposal to register a hook as chainable, since you should already know beforehand if you are going to need it or not.
But any of the three proposals look fine to me. Specially if we can achieve the same goal and not create any breaking changes.
Sorry, something went wrong.
No branches or pull requests
Describe the feature
Hookable hooks will be called sequentially by default with original arguments. But result of each step is not preserved.
We could export a built-in chainable hook runner.
Example from unjs/community#15 (@ChrisGV04)
Some ideas:
chainableCaller
hookable.callHookChained(name, <initial>)
that chains first argThe text was updated successfully, but these errors were encountered: