lib/socket-io-handler.js
function emitToUsers(users, channelName, data) {
        const usersArray = Array.isArray(users) ? users : [users];
        usersArray.map(function (user) {
            Object.keys(io.sockets.sockets).filter(function (key) {
                return io.sockets.sockets[key].transomUser._id.toString() === user._id.toString();
            }).map(function (socketKey) {
                io.sockets.sockets[socketKey].emit(channelName, data);
            });
        });
    }
function emitToUsers(users, channelName, data) {
        const usersArray = Array.isArray(users) ? users : [users];
        usersArray.map(function (user) {
            Object.keys(io.sockets.sockets).filter(function (key) {
                return io.sockets.sockets[key].transomUser._id.toString() === user._id.toString();
            }).map(function (socketKey) {
                io.sockets.sockets[socketKey].emit(channelName, data);
            });
        });
    }
function emitToUsers ( users , channelName , data ) { const usersArray = Array . isArray ( users ) ? users : [ users ] ; usersArray . map ( function ( user ) { Object . keys ( io . sockets . sockets ) . filter ( function ( key ) { return io . sockets . sockets [ key ] . transomUser . _id . toString ( ) === user . _id . toString ( ) ; } ) . map ( function ( socketKey ) { io . sockets . sockets [ socketKey ] . emit ( channelName , data ) ; } ) ; } ) ; }
Emit 'data' to all sockets for the provided User or array of Users.

@param {*} channelName
@param {*} users
@param {*} data
Emit data to all sockets for the provided User or array of Users .