Skip to content

⬅️ Back to Table of Contents

📄 useArrayJoin

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 4
🟢 Vue Composition API 1
📑 Type Aliases 1

📚 Table of Contents

🛠️ File Location:

📂 packages/shared/useArrayJoin/index.ts

📦 Imports

Name Source
ComputedRef vue
MaybeRefOrGetter vue
computed vue
toValue vue

Vue Composition API

Name Type Reactive Variables Composables
computed computed none none

Functions

useArrayJoin(list: MaybeRefOrGetter<MaybeRefOrGetter<any>[…, separator: MaybeRefOrGetter<string>): UseArrayJoinReturn

Reactive Array.join

Parameters:

  • list any: the array was called upon.
  • separator any: a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").

Returns: undefined a string with all array elements joined. If arr.length is 0, the empty string is returned.

See: https://vueuse.org/useArrayJoin

Tags: @__NO_SIDE_EFFECTS__

Raw JSDoc
/**
 * Reactive `Array.join`
 *
 * @see https://vueuse.org/useArrayJoin
 * @param list - the array was called upon.
 * @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").
 *
 * @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.
 *
 * @__NO_SIDE_EFFECTS__
 */

Calls:

  • computed (from vue)
  • toValue(list).map(i => toValue(i)).join
  • toValue (from vue)
Code
export function useArrayJoin(
  list: MaybeRefOrGetter<MaybeRefOrGetter<any>[]>,
  separator?: MaybeRefOrGetter<string>,
): UseArrayJoinReturn {
  return computed(() => toValue(list).map(i => toValue(i)).join(toValue(separator)))
}

Type Aliases

UseArrayJoinReturn

type UseArrayJoinReturn = ComputedRef<string>;

Generated by Syntax Scribe