Skip to content
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

Cleanup method so event listeners are all cleared #19

Open
northkode opened this issue Jan 2, 2016 · 3 comments
Open

Cleanup method so event listeners are all cleared #19

northkode opened this issue Jan 2, 2016 · 3 comments

Comments

@northkode
Copy link

Would be nice to have a bind.cleanup() so that there isn't left over event listeners lying around.

@remy
Copy link
Owner

remy commented Jan 2, 2016

Isn't this solved by exporting the object?

On Sat, 2 Jan 2016 15:58 northkode [email protected] 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
#19.

@northkode
Copy link
Author

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.

@remy
Copy link
Owner

remy commented Jan 2, 2016

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants