promise-ws
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -378,6 +378,10 @@ 'use strict'; | ||
close() { | ||
this._ws && this._ws.terminate(); | ||
this._ws = null; | ||
var _this4 = this; | ||
return _asyncToGenerator(function* () { | ||
_this4._ws && _this4._ws.terminate(); | ||
_this4._ws = null; | ||
})(); | ||
} | ||
} | ||
exports.default = Client; |
@@ -91,3 +91,3 @@ 'use strict'; | ||
/* istanbul ignore next */ | ||
const types = emitter.eventNames() || Object.keys(emitter._events); | ||
const types = typeof emitter.eventNames === 'function' ? emitter.eventNames() : Object.keys(emitter._events); | ||
@@ -94,0 +94,0 @@ types.forEach(type => { |
{ | ||
"name": "promise-ws", | ||
"description": "A Promise-Based WebSocket implementation for Node.js", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"main": "lib/index", | ||
@@ -6,0 +6,0 @@ "files": [ |
@@ -28,2 +28,3 @@ # promise-ws | ||
* [server#replyCount\(name\)](#serverreplycountname) | ||
* [server#replyClose\(shouldClose\)](#serverreplycloseshouldclose) | ||
* [server#request\(name\[, ...args\]\)](#serverrequestname-args) | ||
@@ -142,2 +143,8 @@ * [server#wss\(\)](#serverwss) | ||
### server#onReplyClose(shouldClose) | ||
1. `shouldClose` \<Function\>: The callback function to decide to close or not. Should return a promise with a Boolean. | ||
Add a reply to close function. Will be called when client calls `requestClose()`. If `shouldClose` returns `true`, the server will be closed. | ||
### server#request(name[, ...args]) | ||
@@ -144,0 +151,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30751
520
378