Why does this act as a singleton in NodeJS, how does it work?
const io = require('socket.io')();
const singleton = module.exports = io;
In essence, if I import this file more than once, I get the first instantiated socket.io
instance.
via Seyi Adekoya
No comments:
Post a Comment