diff --git a/src/apis/watch.ts b/src/apis/watch.ts index 3e130ee7..9c165f58 100644 --- a/src/apis/watch.ts +++ b/src/apis/watch.ts @@ -400,6 +400,10 @@ export function watchPostEffect(effect: WatchEffect) { return watchEffect(effect, { flush: 'post' }) } +export function watchSyncEffect(effect: WatchEffect) { + return watchEffect(effect, { flush: 'sync' }) +} + // overload #1: array of multiple sources + cb // Readonly constraint helps the callback to correctly infer value types based // on position in the source array. Otherwise the values will get a union type