UNPKG

@cran/vue.use

Version:

Cranberry Vue Use Utilities

10 lines (9 loc) 292 B
import { eager } from "@cran/vue.ref"; import { useNow } from "./useNow"; export function useSince(time) { const timestamp = time instanceof Date ? time.valueOf() : time; const { now, } = useNow(); return eager(function compute() { return now.value - timestamp; }); }