-
Notifications
You must be signed in to change notification settings - Fork 23
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
Removing hooks? #31
Comments
Hi Chris, the https://github.com/apotonick/hooks/blob/master/lib/hooks.rb#L25 |
Thanks for pointing to the use of With respect to safety - I shouldn't have said "memory leak." Poor question asking on my part, I apologize. I should have instead asked whether you create any other references to the callable objects stored in |
It's a valid, justified question! I had many memory leaks!..... with ActiveRecord haha! 😬 If you change the |
In my use case, I'm wanting to dynamically add-and-remove instance hooks. Like I said, I may be pushing the design boundaries of the gem to the breaking point. |
Uhm, no, no. I haven't worked with this gem for a long time, but I can't see why this wouldn't work. Have you considered using Trailblazer's |
I don't see any (documented or not) method to remove a hook. Is this possible, even if not fully supported? How would I do this?
If I wanted to remove all Hooks by name, it looks like I might be able to run
self._hooks[:hook_name] = nil
but it's not clear thatI know this is more a pub/sub workflow than hooking, strictly speaking, but it would be awfully helpful (to my current challenge). Lacking a proper solution or viable hack, I'll have to rip out this gem and replace it with a pub/sub alternative, which I don't look forward to.
The text was updated successfully, but these errors were encountered: