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

Call dispose on destroy for any observable created with knockout.defineProperty #5216

Closed
hpinkos opened this issue Apr 18, 2017 · 5 comments
Closed

Comments

@hpinkos
Copy link
Contributor

hpinkos commented Apr 18, 2017

The knockout es5 plugin creates a knockout.computed behind the scenes when we call knockout.defineProperty. This computed listens to observables indefinitely unless we call knockout.getObservable(this, propertyName).dispose(). This should be done in the destroy function for our widgets.

@mramato
Copy link
Contributor

mramato commented Apr 18, 2017

The version of the es5 plugin we are using is beyond ancient, it might be a good idea to update it and check if it fixes this issue as well.

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 18, 2017

@mramato
Copy link
Contributor

mramato commented Apr 18, 2017

Thanks. You should probably report a bug on their repository and verify that what you're suggesting is the correct fix. I totally buy that what you're suggesting is needed, but we shouldn't let issues/bugs go unreported for the libraries we use.

@hpinkos
Copy link
Contributor Author

hpinkos commented Apr 18, 2017

I don't know if it's really a bug on their end. It's the same as us recognizing that we need to dispose on subscriptions when our classes are destroyed

@ggetz
Copy link
Contributor

ggetz commented Apr 13, 2023

Given that we're likely to move away from knockout in the future, this is unlikely to become a priority anytime soon. We'd still happily accept a PR addressing this issue. But tracking this isn't particularly useful because of its low priority, so I will close it. Thanks!

@ggetz ggetz closed this as completed Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment