unjs / unjs/hookable

removeXxx should return the removed hooks

Open
#113 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
960
Forks
43
Avg merge
19m
Merged PRs (30d)
1

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Start by locating the existing hook-removal API and its tests, then clarify the return shape for single and multiple hooks and the behavior of callbacks returning false; done means the requested retrieval, removal, reordering, and stopping behavior are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.