Skip to content

parent and child with watchEffect and emits causing endless loop #13501

Discussion options

You must be logged in to vote

emit is synchronous, with any handlers being run immediately. This can lead to properties being tracked from watchEffect. This is a common source of problems and #6688 aims to fix that, though it remains unclear whether that will be merged.

The code you provided contains some small mistakes, where you're using loading_counter instead of loading_counter.value. If any of those mistakes are also present in your original code then they might be compounding the problem.

There are various ways to write the code to avoid the tracking problem, depending on whether you want to apply the fix in the parent or the child. Based on what you wrote, I'm assuming you'd prefer to fix this in the parent.

e.…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@quantumdot
Comment options

Answer selected by quantumdot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants