@cran/lib.vue.ref
Version:
Vue Reactivity Extensions
15 lines (14 loc) • 414 B
JavaScript
import { computed } from "vue";
import { wrapArrayReducer } from "./ArrayReducer";
import { unwrap } from "../utility";
/**
* @since 0.0.1
* @category Array
* @inheritdoc Array#reduceRight
*/
export function useReduceRight(values, callbackfn, initialValue) {
return computed(function compute() {
return unwrap(values)
.reduceRight(wrapArrayReducer(callbackfn), initialValue);
});
}