Skip to content

Commit e12c23d

Browse files
committed
feat: new watchSyncEffect api
1 parent 31d85d4 commit e12c23d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/apis/watch.ts

+4
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ export function watchPostEffect(effect: WatchEffect) {
400400
return watchEffect(effect, { flush: 'post' })
401401
}
402402

403+
export function watchSyncEffect(effect: WatchEffect) {
404+
return watchEffect(effect, { flush: 'sync' })
405+
}
406+
403407
// overload #1: array of multiple sources + cb
404408
// Readonly constraint helps the callback to correctly infer value types based
405409
// on position in the source array. Otherwise the values will get a union type

0 commit comments

Comments
 (0)