fritz2
fritz2 copied to clipboard
Rename `classes` utility function to `joinClassNames` in order to reduce naming confusion
The classes-utility function just joins arbitrary Strings with classnames to one String. It takes care of adding aprropriate spaces and drops null values.
The name was meant to be short, but as it seems quite often it competes with some parameter named also classes, which is just passed through from higher call sites. This reads not nicely:
classes(classes, "... some local added classes", ...)
It might be better to add some suffix to express its functionality: Joining of different pieces of classnames, though joinClassNames or joinClasses?
joinClassNames(classes, "... some local added classes", ...)
We could mark the current function with @Deprecated("renamed to ``joinClassNames()``", ReplaceWith("joinClassNames(classes)")) in order to enable a smoother transition.
I would lean towards joinClasses as the shorter name seems more practical to me, especially since the classes function is used rather frequently.