You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, to completely unhook a method, we have to make a call to Collection.unhook() for each time we hooked that particular method with Collection.pre() or Collection.post(). This is because the underlying hooker module just rewraps a hooked function each time it gets hooked.
We could either:
Write our own hooking library/use a different one
Unfortunately, the popular hooks-js (and forks) don't hook correctly onto instances that are also constructors, such as Collection instances (which is a known issue: Hooks for static methods? bnoguchi/hooks-js#14, cause is this line always preferring the prototype)
Keep a hook count and have unhook() call the underlying hooker.unhook() that many times
The text was updated successfully, but these errors were encountered:
Right now, to completely unhook a method, we have to make a call to
Collection.unhook()
for each time we hooked that particular method withCollection.pre()
orCollection.post()
. This is because the underlyinghooker
module just rewraps a hooked function each time it gets hooked.We could either:
Collection
instances (which is a known issue: Hooks for static methods? bnoguchi/hooks-js#14, cause is this line always preferring the prototype)unhook()
call the underlyinghooker.unhook()
that many timesThe text was updated successfully, but these errors were encountered: