You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
voluntadpear
changed the title
onCleanup callback is not executed when watch stops
onCleanup callback is not executed when the watcher stops
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. theonCleanup
function registered on thewatch
is never executed when the component is unmounted, which is one of the expected behaviors as described in the API reference: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 providedinput
.It could be however that I'm misinterpreting the expected behavior.
Thank you!
The text was updated successfully, but these errors were encountered: