Open northkode opened 8 years ago
Isn't this solved by exporting the object?
On Sat, 2 Jan 2016 15:58 northkode notifications@github.com wrote:
Would be nice to have a bindcleanup() so that there isn't left over event listeners lying around
— Reply to this email directly or view it on GitHub https://github.com/remy/bind.js/issues/19.
Not that I can see.. Your export just makes sure the getter setters aren't there so you hqve a vanilla object to use, but it doesn't call any removeEventListener on any Dom or input item, that had been created on binding. Thefore even if you export, those Dom items can never be released from memory and will just eventually clog up an app. Especially a mobile hybrid one.
Ah ha. You're absolutely right. Hmm...yeah, it should have an unbind methods then too. Good shout.
Do you want to have a go at a PR for this?
Would be nice to have a bind.cleanup() so that there isn't left over event listeners lying around.