I have developed an amazing plugin called https://github.com/suprMax/Zepto-onPress
Everything works perfectly except for one small issue. When I receive a callback function, I need to store it along with my actual event handler so that I can detach it when someone attempts to remove the event handler and provide me with the original callback. Essentially, I need the ability to store multiple key-value pairs per element where the key is supposed to be a function and the value is also a function. I tried to implement this functionality, but currently the script internally generates this:
(function(){}).toString()
This method is not ideal as it may result in removing incorrect event handlers due to :
(function(){}).toString() === (function(){}).toString().
I believe there must be a better approach to achieve this. Any suggestions would be greatly appreciated.