Big update!Introducing GitHub Bot Commands. Learn more
Socket
BlogLoveLog in
Book a demo

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

Version published
Maintainers
1
Weekly downloads
12,710,855
increased by2.45%

Weekly downloads

Changelog

Source

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 12,170,622 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
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc