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

Hook inheritance #430

Closed
1 task done
tandemdude opened this issue Jul 21, 2024 · 1 comment
Closed
1 task done

Hook inheritance #430

tandemdude opened this issue Jul 21, 2024 · 1 comment
Labels
enhancement New feature or request v3 Applies to V3 (not V2)

Comments

@tandemdude
Copy link
Owner

Summary

Allow commands to inherit hooks from their Loader, and the Client upon execution. Hook order behaviour should be explicitly documented.

Why is this needed?

Reduces the need for duplicating all the hooks to run within every single command definition.

Ideal implementation

To be decided.

Checklist

  • I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
@tandemdude tandemdude added enhancement New feature or request v3 Applies to V3 (not V2) labels Jul 21, 2024
@tandemdude
Copy link
Owner Author

Implemented for the Client. If you wish to use common hooks for a loader you should specify them as a variable and unpack them into the command. For example

common_hooks = [...]

class YourCommand(
    ...,
    hooks=[*common_hooks, ...]
):
    ...

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

No branches or pull requests

1 participant