purescript-web/purescript-web-dom

No Element -> DOMTokenList

Closed this issue · 4 comments

There's a HTMLElement -> Effect DOMTokenList in web-html but that's a big dep when wanting to work on classes and it seems getting a DOMTokenList is valid for any element and Element is in web-dom. Any reason why classList is in web-html. Could we have it in both? Should the one in web-html be in web-dom?

The implementation of classList is a simple method call.

Just trying to understand the why of it mostly.

I'll ask in Slack first come to think of it.

garyb commented

There's no classList in here as this library is for the DOM API, -web-html is for the HTML API, which is where classList is defined 😉

garyb commented

Actually, my mistake, classList is defined for both Element and HTMLElement interfaces, so yeah it could be added here.

I'll make the PR! 🙌