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

watchEffect infinite loops

SebMik opened this issue · comments

Mutating reactive data inside watchEffect causes an infinite loop. This seems like it can be mitigated by adding flush: 'sync', but then it doesn't always track dependencies correctly, like when sorting a list. Everything works as expected in vue 3.

And yes, I know I could make it a computed, but I need to mutate the original array.

Vue 2 example
Vue 3 example

Stale issue message