MCPcopy Create free account
hub / github.com/cn-docs/vueuse / useArrayJoin

Function useArrayJoin

packages/shared/useArrayJoin/index.ts:13–18  ·  view source on GitHub ↗
(
  list: MaybeRefOrGetter<MaybeRefOrGetter<any>[]>,
  separator?: MaybeRefOrGetter<string>,
)

Source from the content-addressed store, hash-verified

11 * @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.
12 */
13export function useArrayJoin(
14 list: MaybeRefOrGetter<MaybeRefOrGetter<any>[]>,
15 separator?: MaybeRefOrGetter<string>,
16): ComputedRef<string> {
17 return computed(() => toValue(list).map(i => toValue(i)).join(toValue(separator)))
18}

Callers 1

index.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected