thedesk/app/node_modules/defer-to-connect/index.js
2019-09-12 23:38:13 +09:00

10 lines
168 B
JavaScript

'use strict';
module.exports = (socket, callback) => {
if (socket.writable && !socket.connecting) {
callback();
} else {
socket.once('connect', callback);
}
};