• Creates a function that generates DOM classes with a specified prefix (namespace).

    Parameters

    • namespace: string

      The prefix to be added to the generated classes.

    Returns ((...params) => string)

    A function that takes an array of class names, prefixes them with the namespace, and returns a string of space-separated class names.

      • (...params): string
      • Parameters

        • Rest ...params: ArgumentArray

        Returns string

    Example

    const cx = cxFactory('my-namespace');
    cx('class1', 'class2'); // Returns 'my-namespace-class1 my-namespace-class2'