@cran/lib.vue.ref
Version:
Vue Reactivity Extensions
19 lines (16 loc) • 486 B
text/typescript
import { computed } from "vue";
import { type ArrayPredicate, wrapArrayPredicate } from "./ArrayPredicate";
import { type MaybeWrapped, unwrap } from "../utility";
/**
* @since 0.0.1
* @category Array
* @inheritdoc Array#findLastIndex
*/
export function useFindLastIndex<T> (
values: MaybeWrapped<Array<MaybeWrapped<T>>>,
predicate: ArrayPredicate<T>
) {
return computed(function compute ( ) {
return unwrap(values).findLastIndex(wrapArrayPredicate(predicate));
});
}