UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

14 lines (13 loc) 371 B
import { computed } from "vue"; import { wrapArrayPredicate } from "./ArrayPredicate"; import { unwrap } from "../utility"; /** * @since 0.0.1 * @category Array * @inheritdoc Array#findIndex */ export function useFindIndex(values, predicate) { return computed(function compute() { return unwrap(values).findIndex(wrapArrayPredicate(predicate)); }); }