Post

general advice is to not modify the prototypes of third-party code and i’m not sure what the first line of the function gets you. but i think wrapping customElements.define like this is fine!

That first line just checks to make sure the component argument is a JS class. And yeah, I think this is maybe the first time I’ve ever extended a third-party object in this way. But it was such a small little hack I didn’t even give general "best practices" a very thorough consideration. 🤪

0 reposts0 likes

No replies yet.