UNPKG

@cran/lib.vue.ref

Version:

Vue Reactivity Extensions

18 lines (15 loc) 389 B
import { computed } from "vue"; import { type MaybeWrapped, unwrap } from "../utility"; /** * @since 0.0.1 * @category Array * @inheritdoc Array#join */ export function useJoin ( values: MaybeWrapped<Array<MaybeWrapped>>, separator?: MaybeWrapped<string> ) { return computed(function compute ( ) { return unwrap(values).map<string>(unwrap).join(unwrap(separator)); }); }