UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

20 lines (19 loc) 467 B
import { nextTick, watch } from "vue"; let ticking = false; const collector = []; /** * @since 0.0.1 * @category Watch */ export function watchMonitor(name, source) { return watch(source, function onSourceChange(next, prev) { if (!ticking) { ticking = true; void nextTick(processQueue); } collector.push({ name, prev, next, time: performance.now(), }); }); } function processQueue() { ticking = false; }