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

Docs should advise this.observe("$foo") over this.store.observe("foo") in oncreate handlers #272

Closed
PixievoltNo1 opened this issue Apr 13, 2018 · 1 comment

Comments

@PixievoltNo1
Copy link

PixievoltNo1 commented Apr 13, 2018

According to sveltejs/svelte#1181, only observers of the former form will be destroyed if the component is destroyed, yet the docs tell people to use the latter form in this section, and don't document the former anywhere. This could direct developers to shoot themselves in the foot and write memory-leaking apps.

@Rich-Harris
Copy link
Member

Thanks — I went the other way, documenting that the listener should be removed, as listening for $foo has caveats (the component will only receive those changes if $foo is referenced in the template or in a computed property)

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

No branches or pull requests

2 participants