@cran/lib.vue.ref
Version:
Vue Reactivity Extensions
17 lines (14 loc) • 350 B
text/typescript
import { computed } from "vue";
import { type MaybeWrapped, unwrap } from "../utility";
/**
* @since 0.0.1
* @category Array
* @inheritdoc Array#toReversed
*/
export function useReversed<T> (
values: MaybeWrapped<Array<MaybeWrapped<T>>>
) {
return computed(function compute ( ) {
return unwrap(values).map<T>(unwrap).reverse();
});
}