4 ms·
modern patterns, but you include a singleton??? seriously, please reply to me if you actually implemented a singleton in the past 2 years
by whoomp12342 4y ago
modern patterns, but you include a singleton??? seriously, please reply to me if you actually implemented a singleton in the past 2 years
- ohthatsnotright 4y agoIs that not what a named export of a const declared inside a single JS file does, though? e.g. for node, the first time the file is loaded it is evaluated which would assign the const, and then the export is given to all files so unless you have a fun circular dependency you should arrive at exactly one instance.