From 92fe90ce19e86bdf4509a75bb12a01fbaffb435c Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 9 Aug 2021 16:49:46 +0800 Subject: [PATCH] feat: new watchPostEffect api --- src/apis/watch.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apis/watch.ts b/src/apis/watch.ts index 5efd3405..3e130ee7 100644 --- a/src/apis/watch.ts +++ b/src/apis/watch.ts @@ -396,6 +396,10 @@ export function watchEffect( return createWatcher(vm, effect, null, opts) } +export function watchPostEffect(effect: WatchEffect) { + return watchEffect(effect, { flush: 'post' }) +} + // 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