You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add: Callback Flush Timing - About the flush: sync
Add content that watchers.md : Callback Flush Timing - About the flush: sync option
Among the options used for watch, `flush: 'sync'` was not explained in the guide or API documentation, so I added it.
It need to check because my English is not good.
Hope this helps.
Copy file name to clipboardExpand all lines: src/guide/essentials/watchers.md
+51Lines changed: 51 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -342,6 +342,57 @@ watchPostEffect(() => {
342
342
343
343
</div>
344
344
345
+
The `flush: 'pre'|'post'` option buffers the callback so that it is only called once at the end, even if there are multiple state changes in the same "tick".
346
+
347
+
The `flush: 'sync'` option should be used if the callback needs to be invoked synchronously on every state change multiple times within the same tick.
0 commit comments