feat(runtime-core): watchSyncEffect
This commit is contained in:
@@ -96,6 +96,19 @@ export function watchPostEffect(
|
||||
)
|
||||
}
|
||||
|
||||
export function watchSyncEffect(
|
||||
effect: WatchEffect,
|
||||
options?: DebuggerOptions
|
||||
) {
|
||||
return doWatch(
|
||||
effect,
|
||||
null,
|
||||
(__DEV__
|
||||
? Object.assign(options || {}, { flush: 'sync' })
|
||||
: { flush: 'sync' }) as WatchOptionsBase
|
||||
)
|
||||
}
|
||||
|
||||
// initial value for watchers to trigger on undefined initial values
|
||||
const INITIAL_WATCHER_VALUE = {}
|
||||
|
||||
|
||||
@@ -34,7 +34,12 @@ export {
|
||||
getCurrentScope,
|
||||
onScopeDispose
|
||||
} from '@vue/reactivity'
|
||||
export { watch, watchEffect, watchPostEffect } from './apiWatch'
|
||||
export {
|
||||
watch,
|
||||
watchEffect,
|
||||
watchPostEffect,
|
||||
watchSyncEffect
|
||||
} from './apiWatch'
|
||||
export {
|
||||
onBeforeMount,
|
||||
onMounted,
|
||||
|
||||
Reference in New Issue
Block a user