mirror of
https://github.com/fluencelabs/js-libp2p-websockets
synced 2025-06-10 22:21:42 +00:00
move error to callback
This commit is contained in:
@ -61,7 +61,7 @@ function WebSockets () {
|
|||||||
|
|
||||||
this.close = (callback) => {
|
this.close = (callback) => {
|
||||||
if (listeners.length === 0) {
|
if (listeners.length === 0) {
|
||||||
throw new Error('there are no listeners')
|
callback(new Error('there are no listeners'))
|
||||||
}
|
}
|
||||||
var count = 0
|
var count = 0
|
||||||
listeners.forEach((listener) => {
|
listeners.forEach((listener) => {
|
||||||
|
Reference in New Issue
Block a user