r/JavaScriptTips • • Oct 31 '21

How to do a Singleton in JavaScript

https://ultirequiem.com/post/singleton-javascript/
1 Upvotes

1 comment sorted by

2

u/alfonzodibonzo Oct 31 '21

This looks like a bad idea to me - import should not really produce a side effect. I have seen lots of bugs in JavaScript where this has been th cause.