defer-to-connect

WebJar for defer-to-connect

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

defer-to-connect
Последняя версия

Последняя версия

1.1.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

defer-to-connect
WebJar for defer-to-connect
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/szmarczak/defer-to-connect

Скачать defer-to-connect

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/defer-to-connect/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>defer-to-connect</artifactId>
    <version>1.1.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/defer-to-connect/
implementation 'org.webjars.npm:defer-to-connect:1.1.3'
// https://jarcasting.com/artifacts/org.webjars.npm/defer-to-connect/
implementation ("org.webjars.npm:defer-to-connect:1.1.3")
'org.webjars.npm:defer-to-connect:jar:1.1.3'
<dependency org="org.webjars.npm" name="defer-to-connect" rev="1.1.3">
  <artifact name="defer-to-connect" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='defer-to-connect', version='1.1.3')
)
libraryDependencies += "org.webjars.npm" % "defer-to-connect" % "1.1.3"
[org.webjars.npm/defer-to-connect "1.1.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

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

Версии библиотеки

Версия
1.1.3