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

Some sort of property to destroy the observer. #10

Open
megamidge opened this issue Jul 24, 2019 · 3 comments
Open

Some sort of property to destroy the observer. #10

megamidge opened this issue Jul 24, 2019 · 3 comments
Labels

Comments

@megamidge
Copy link

It would be useful if there was a way to destroy the observer created by the component when we're done with it.
For example, if you're using the observer to load some content once its in view, there's no use the observer existing after that point, as the content is loaded now and nothing will happen if it leaves view and comes back.
This could be implemented using a property or something - pass in a computed boolean and then watch it. If it changes to 'true' then destroy the observer, if it changes to 'false', maybe bring the observer back (not really as important).

@juanpprieto
Copy link

+1

@jasontheiler
Copy link

+1

@MartinMalinda
Copy link

If anyone's interested I've added a once prop here, that disconnects the observer after first enter.

#26

I guess ideally the whole observer could be passed in slot props, and I tried to do that, but I had some issue with it in my case. But for me once is all I need.

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

No branches or pull requests

5 participants