import type { UnwrapRef } from 'vue'; import { reactive, toRef } from 'vue'; /** * Reactively pick fields from a reactive object * * @see https://vueuse.js.org/reactivePick */ export function reactivePick( obj: T, ...keys: K[] ): { [S in K]: UnwrapRef } { return reactive(Object.fromEntries(keys.map(k => [k, toRef(obj, k)]))) as any; }