@cran/lib.vue.ref
Version:
Vue Reactivity Extensions
22 lines (17 loc) • 416 B
text/typescript
import { computed } from "vue";
import { type MaybeWrapped, unwrap } from "../utility";
/**
* @since 0.0.1
* @category Statistics
*/
export function useStatMin (
values: MaybeWrapped<Array<MaybeWrapped<number>>>
) {
return computed(function compute ( ) {
let result = Infinity;
for (const value of unwrap(values)) {
result = Math.min(result, unwrap(value));
}
return result;
});
}