architecture.hooks icon indicating copy to clipboard operation
architecture.hooks copied to clipboard

Hook class with toggler and handler types?

Open Ambrevar opened this issue 6 years ago • 3 comments

What do you think of adding slots to the hook classes:

  • An enabled? slot, which, when nil, makes run-hook ineffective. It's an easy way for the user to toggle hooks at run-time.

  • The type of the handlers slot. We can indeed deftype a list of function types to give a (compile-time) type guarantee if the hook contains accepted handlers or not.

Thoughts?

CC @vindarel

Ambrevar avatar Sep 17 '19 07:09 Ambrevar

As a user, after some testing (in Next), I don't feel the need of an enabled? slot per hook but a global switch that allows to disable/enable all hooks altogether.

Type warnings would be awesome.

Also, I was looking for a list of all the installed hooks, maybe it can be added here.

vindarel avatar Sep 17 '19 10:09 vindarel

Since you people seem to have much broader requirements and also seem to be able to put in much more effort than I can (at the moment), let me again suggest that you work in a fork for now instead of letting me hold you back.

scymtym avatar Sep 17 '19 10:09 scymtym

Will do! No worries, you are not holding us back, even if you don't have time to put into this it's good to have a public discussion on this and hear your opinion about those suggestions :)

@vindarel: if we are more local, we can always be global, while the reverse is not true. So if we can toggle a specific mode and we can list all modes, then it's trivial to disable all modes.

Ambrevar avatar Sep 17 '19 11:09 Ambrevar