UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

17 lines (14 loc) 356 B
import { type MaybeWrapped, eagerComputed, unwrap } from "../utility"; /** * @since 0.0.1 * @category Array * @inheritdoc Array#at */ export function useAt<T> ( values: MaybeWrapped<Array<MaybeWrapped<T>>>, index: MaybeWrapped<number> ) { return eagerComputed(function compute ( ) { return unwrap(unwrap(values).at(unwrap(index))); }); }