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

onCleanup callback is not executed when the watcher stops #113

Closed
voluntadpear opened this issue Sep 3, 2019 · 0 comments
Closed

onCleanup callback is not executed when the watcher stops #113

voluntadpear opened this issue Sep 3, 2019 · 0 comments

Comments

@voluntadpear
Copy link

voluntadpear commented Sep 3, 2019

Reproduction link: https://codesandbox.io/s/watcher-clean-up-issue-elnq1

Open the console and toggle the Child component a few times. the onCleanup function registered on the watch is never executed when the component is unmounted, which is one of the expected behaviors as described in the API reference:

The cleanup callback is called when:

the watcher is about to re-run
the watcher is stopped (i.e. when the component is unmounted if watch is used inside setup())

I also tried to manually stop the watch and the onCleanup callback doesn't run then either. It does run however before the watcher is about to re-run, as you can see by typing something on the provided input.

It could be however that I'm misinterpreting the expected behavior.

Thank you!

@voluntadpear voluntadpear changed the title onCleanup callback is not executed when watch stops onCleanup callback is not executed when the watcher stops Sep 3, 2019
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

1 participant