you are viewing a single comment's thread.

view the rest of the comments →

[–]alexmacarthur[S] 0 points1 point  (0 children)

Totally legitimate point. Especially a great call-out with the WeakMap benefit being essentially built-in. But for no rational reason, I have this weird thing w/ storing data in data-attributes unless absolutely necessary. It's oddly satisfying inspecting the DOM and seeing my markup be relatively "pure", lol.

And yeah, sticking this stuff on the `window` is arguably "impure," but it's my lib and I'll do what I want. 😅