bsdfzzzy / vue2-hammer

Hammer.js wrapper for Vue 2.x to support some touching operation in the mobile.
MIT License
253 stars 48 forks source link

Destroy method? #26

Open mateuswetah opened 5 years ago

mateuswetah commented 5 years ago

Hi there, thanks for the awesome plugin.

This is more of a question than a bug. Is there a way to destroy my vue2-hammer instance? I'm facing some memory leaks on my code and I know it could be due to a bunch of things, but my profile analysis tells me that HammerJS is one of the memory eaters. Reading about memory leaks on VueJS documentation tells me that I should take care of calling destroy() methods as much as I can when using third-party libraries in my beforeDestroy() lifecycle hook...

Would you suggest anything? I'm using it only in one component actually, as a directive.