UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

13 lines (10 loc) 264 B
import { type Ref, type WatchSource, watch } from "vue"; /** * @since 0.2.0 * @category Controller */ export function usePipe<T> ( source: WatchSource<T>, target: Ref<T> ) { return watch(source, function onChange ( next ) { target.value = next; }); }