vuejs / composition-api

Composition API plugin for Vue 2
https://composition-api.vuejs.org/
MIT License
4.19k stars 343 forks source link

watchEffect infinite loops #937

Closed SebMik closed 2 years ago

SebMik commented 2 years ago

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

github-actions[bot] commented 2 years ago

Stale issue message