Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a dedupe version? #13

Closed
deviprsd opened this issue Jul 31, 2019 · 2 comments
Closed

a dedupe version? #13

deviprsd opened this issue Jul 31, 2019 · 2 comments

Comments

@deviprsd
Copy link

A possible dedupe version so that classes aren't repeated twice?

@lukeed
Copy link
Owner

lukeed commented Jul 31, 2019

Hey, I don't think so 🙈 While it's certainly easy to implement, I've not actually seen a need for this in apps. It's also easy to implement yourself the 1 time (out of 500) you might actually need this.

Mostly I want to avoid the complexity of shipping multiple entry points, all with multiple formats... because the one time you or a coworker adds an import to clsx/dedupe, you now have two different copies of clsx floating around in your bundle.

Hoping I explained that well enough – the verbal side of my head isn't working today~
Closing for now, Thanks!

@lukeed lukeed closed this as completed Jul 31, 2019
@dy
Copy link

dy commented Aug 27, 2019

Stumbled upon the same.
Dedupe version is actually really useful for cases, when we deal with existing components, not react, where we create component from scratch each time.
Eg. that would enable

el.classList.value = clsx(...Array.from(el.classList), ...additionalClasses)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants