vuejs / composition-api

Composition API plugin for Vue 2

Home Page:https://composition-api.vuejs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internal watcher retained after hook:destroyed?

nerdcave opened this issue · comments

Should this watcher be set to null upon hook:destroyed?

I'm working on an app where a destroy() call causes "shared" computeds to stop updating. I believe Vue is removing its subscriptions under the hood while this watcher in the composition-api plugin is retained.

Code in following comment...

I was able to create a minimal example that reproduces the bug: https://github.com/nerdcave/composition-bug

Clone the repo, run yarn install then yarn test:unit. The last expect in the test fails.

Not a bug, it's a scope issue. Just discovered new EffectScope(true), which fixes it.