UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

13 lines (12 loc) 254 B
import { watch } from "vue"; /** * @since 0.0.1 * @category Watch */ export function watchOnce(source, cb, options) { const stop = watch(source, function onChange(...args) { stop(); cb(...args); }, options); return stop; }