jorgebucaran / classcat

Build a class attribute string quickly
MIT License
906 stars 22 forks source link

Added string array to declaration #28

Closed tachyon-ops closed 3 years ago

tachyon-ops commented 5 years ago

Added string array to allow a string array to be passed to the classcat() function. Tested and working.

jorgebucaran commented 5 years ago

Can you add a usage test here?

tachyon-ops commented 5 years ago

Sure:

<nav className={cc([ css.navbar, 'navbar-default', 'navbar-fixed-top' ])}>

It yields

<nav class="navbar navbar-default navbar-fixed-top">
tachyon-ops commented 5 years ago

Intellj is always complaining with current definition.

jorgebucaran commented 5 years ago

@nmpribeiro Thanks, but the usage test should be added here:

tachyon-ops commented 5 years ago
["btn", "btn-active"],

Is type string[]

jorgebucaran commented 5 years ago

@nmpribeiro Added string array to allow a string array to be passed to the classcat() function.

I believe arrays are already covered here.

https://github.com/jorgebucaran/classcat/blob/9d08dbf8d7fd8663fd942df0c108c7a96e7040c9/classcat.d.ts#L7

Correct me if I am wrong, but this PR doesn't allow you to do anything that isn't already allowed here.

tachyon-ops commented 5 years ago

Hum, yes it's already functioning. The reason for my proposal was due to the fact WebStorm doesn't seem able to pick ClassArray, so I get annoying errors on the idea.

Let me see these days if I can support my claim a bit better

jorgebucaran commented 3 years ago

It's been a while and this simply fell off my radar. Are you still interested in this? @nmpribeiro 👋

tachyon-ops commented 3 years ago

Hi, huu I haven’t used it for a while now... even moved away from intellij

jorgebucaran commented 3 years ago

Fine. Let's close then! 👌