summaryrefslogtreecommitdiff
path: root/node_modules/defer-to-connect/README.md
diff options
context:
space:
mode:
authorLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
committerLinuxWizard42 <computerwizard@linuxmail.org>2022-10-12 22:54:37 +0300
commit703e03aba33f234712206769f57717ba7d92d23d (patch)
tree0041f04ccb75bd5379c764e9fe42249fffe75fc3 /node_modules/defer-to-connect/README.md
parentab6e257e6e9d9a483d7e86f220d8b209a2cd7753 (diff)
downloadFlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.gz
FlashRunner-703e03aba33f234712206769f57717ba7d92d23d.tar.zst
Added export_allowed file to make repository visible in cgit
Diffstat (limited to 'node_modules/defer-to-connect/README.md')
-rw-r--r--node_modules/defer-to-connect/README.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/node_modules/defer-to-connect/README.md b/node_modules/defer-to-connect/README.md
new file mode 100644
index 0000000..4dd36c2
--- /dev/null
+++ b/node_modules/defer-to-connect/README.md
@@ -0,0 +1,38 @@
+# defer-to-connect
+
+> The safe way to handle the `connect` socket event
+
+[![Coverage Status](https://coveralls.io/repos/github/szmarczak/defer-to-connect/badge.svg?branch=master)](https://coveralls.io/github/szmarczak/defer-to-connect?branch=master)
+
+Once you receive the socket, it may be already connected (or disconnected).<br>
+To avoid checking that, use `defer-to-connect`. It'll do that for you.
+
+## Usage
+
+```js
+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.<br>
+Calls `secureConnect()` when the socket is securely connected.<br>
+Calls `close()` when the socket is destroyed.
+
+## License
+
+MIT