davestewart/vue-class-store

Vue 3 watch lifetime issues

Closed this issue · 1 comments

In Vue 3 you manually stop watches, which led me to think about the possibility of them causing memory leaks. I've started writing tests to investigate this, and it seems to be the case only when using @VueStore and not VueStore.create, which is odd. I'm also investigating the possibility that any store that happens to be initialized during a component's setup function will have its watches stopped when that component unmounts.

After more investigation, I've learned that testing memory leaks in JavaScript is a nightmare… but it doesn't seem that on:... watches will leak objects.