Thanks to visit codestin.com
Credit goes to github.com

Skip to content

onCleanup callback is not executed when the watcher stops #113

@voluntadpear

Description

@voluntadpear

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions