Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feat: new watchSyncEffect api
  • Loading branch information
antfu committed Aug 9, 2021
1 parent 31d85d4 commit e12c23d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/apis/watch.ts
Expand Up @@ -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
Expand Down

0 comments on commit e12c23d

Please sign in to comment.