Category | Watch |
---|---|
Export Size | 322 B |
Last Changed | 4 days ago |
Shorthand for watching value with
Similar to watch
, but with { immediate: true }
import { watchImmediate } from '@vueuse/core' const obj = ref('vue-use') // changing the value from some external store/composables obj.value = 'VueUse' watchImmediate(nestedObject, (obj) => { console.log(updated) // Console.log will be logged twice })
export declare function watchImmediate<T extends Readonly<MultiWatchSources>>( source: T, cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>, options?: Omit<WatchOptions<true>, "deep"> ): WatchStopHandle export declare function watchImmediate<T>( source: WatchSource<T>, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, "deep"> ): WatchStopHandle export declare function watchImmediate<T extends object>( source: T, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, "deep"> ): WatchStopHandle
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/shared/watchImmediate/