UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

13 lines (12 loc) 299 B
import { computed } from "vue"; import { unwrap } from "../utility"; /** * @since 0.0.1 * @category Array * @inheritdoc Array#toSorted */ export function useSorted(values, compareFn) { return computed(function compute() { return unwrap(values).map(unwrap).sort(compareFn); }); }