Roughing out the demo app
This commit is contained in:
9
node_modules/defer-to-connect/index.js
generated
vendored
Normal file
9
node_modules/defer-to-connect/index.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = (socket, callback) => {
|
||||
if (socket.writable && !socket.connecting) {
|
||||
callback();
|
||||
} else {
|
||||
socket.once('connect', callback);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user