defer-to-connect
Advanced tools
Weekly downloads
Readme
The safe way to handle the
connect
socket event
Once you receive the socket, it may be already connected (or disconnected).
To avoid checking that, use defer-to-connect
. It'll do that for you.
const deferToConnect = require('defer-to-connect');
deferToConnect(socket, () => {
console.log('Connected!');
});
Calls connectListener()
when connected.
An object representing connect
, secureConnect
and close
properties.
Calls connect()
when the socket is connected.
Calls secureConnect()
when the socket is securely connected.
Calls close()
when the socket is destroyed.
MIT
The safe way to handle the `connect` socket event
The npm package defer-to-connect receives a total of 10,075,196 weekly downloads. As such, defer-to-connect popularity was classified as popular.
We found that defer-to-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.