Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

feat(core): Support command hooks #6

Open
sidwebworks opened this issue Jul 4, 2022 · 2 comments
Open

feat(core): Support command hooks #6

sidwebworks opened this issue Jul 4, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@sidwebworks
Copy link
Owner

Would be cool to to .addHook on a command to intercept its lifecycle and maybe do some modifications at runtime.

command.addHook("pre", (args, options, tools) => {
  console.log("This command is about to run with: ", args, options)
})

command.addHook("post", (args, options, tools) => {
  console.log("This command just finished running with: ", args, options)
})
@sidwebworks
Copy link
Owner Author

@nexxeln what do u think? can be used for stuff like validation and pre checks

@sidwebworks sidwebworks added the enhancement New feature or request label Jul 4, 2022
@sidwebworks sidwebworks self-assigned this Jul 4, 2022
@sidwebworks sidwebworks changed the title Support Command hooks feat(core): Support command hooks Jul 4, 2022
@nexxeln
Copy link
Collaborator

nexxeln commented Jul 4, 2022

Yeah this is nice

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

No branches or pull requests

2 participants