UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

17 lines (16 loc) 474 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useFlat = void 0; const vue_1 = require("vue"); const utility_1 = require("../utility"); /** * @since 0.0.1 * @category Array * @inheritdoc Array#flat */ function useFlat(values, depth = 20) { return (0, vue_1.computed)(function compute() { return (0, utility_1.unwrap)(values).map(utility_1.unwrap).flat((0, utility_1.unwrap)(depth)); }); } exports.useFlat = useFlat;