Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inDemoInstall

defer-to-connect

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Issues
File Explorer

Advanced tools

defer-to-connect

The safe way to handle the `connect` socket event

    2.0.1latest
    Github

Version published
Maintainers
1
Weekly downloads
12,447,799
increased by0.32%

Weekly downloads

Readme

Source

defer-to-connect

The safe way to handle the connect socket event

Coverage Status

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.

Usage

const deferToConnect = require('defer-to-connect'); deferToConnect(socket, () => { console.log('Connected!'); });

API

deferToConnect(socket, connectListener)

Calls connectListener() when connected.

deferToConnect(socket, listeners)

listeners

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.

License

MIT

Keywords

FAQs

What is defer-to-connect?

The safe way to handle the `connect` socket event

Is defer-to-connect popular?

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.

Is defer-to-connect well maintained?

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.

Last updated on 24 Feb 2021

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.

Install Socket
Socket[email protected]

Product

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc