Skip to content
New issue

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

removeXxx should return the removed hooks #113

Open
1 task
trydofor opened this issue Feb 18, 2025 · 2 comments
Open
1 task

removeXxx should return the removed hooks #113

trydofor opened this issue Feb 18, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@trydofor
Copy link

Describe the feature

From Nuxt, i want to change the order of the hooks at the top level,
need a way to get the hooks, then sort them or add them again.

Something like this,

  • getHooks(name:string):HookCallback[]
  • removeXxx(xxx):HookCallback[]| HookCallback

and more,

the HookCallback can return boolean,
like Vue's onErrorCaptured hook does,
can return false to prevent other hooks from calling.

Additional information

  • Would you be willing to help implement this feature?
@trydofor trydofor added the enhancement New feature or request label Feb 18, 2025
@nozomuikuta
Copy link
Member

As far as I see, the latter part is potentially related to #87, although the goals of the issues seem to be different.

the HookCallback can return boolean,
like Vue's onErrorCaptured hook does,
can return false to prevent other hooks from calling.

Anyway, it's good for one issue to handle one goal, so would you either create a new issue or add a comment to #87 for further discussion, and let this issue focus on the topic of the title?

@nozomuikuta
Copy link
Member

nozomuikuta commented Feb 21, 2025

the HookCallback can return boolean,
like Vue's onErrorCaptured hook does,
can return false to prevent other hooks from calling.

This part would be also potentially related to or even conflict with the goal of #111 as well.
I guess it's good to discuss "chaining" things in one issue (return value chaining, stoppable chaining, interruptible(?) chaining (#104))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants