finishing touches
This commit is contained in:
parent
fe45cb4beb
commit
289dbcd523
@ -1,2 +0,0 @@
|
|||||||
- Don't use arrays for callbacks because there's no way to clear them,
|
|
||||||
passing undefined or null to on* should clear the callback
|
|
@ -49,7 +49,9 @@ export class Conn {
|
|||||||
if (err instanceof ProtocolError) {
|
if (err instanceof ProtocolError) {
|
||||||
this.#errorCallback?.(err)
|
this.#errorCallback?.(err)
|
||||||
} else {
|
} else {
|
||||||
// TODO Not sure if this is the case?
|
// TODO Not sure if this is the best idea.
|
||||||
|
// Investigate what WebSocket does if the callback throws?
|
||||||
|
// Either way it seems like the best idea is to have `onError` called on all types of errors
|
||||||
throw err
|
throw err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ interface ConnState {
|
|||||||
*/
|
*/
|
||||||
auth: boolean
|
auth: boolean
|
||||||
/**
|
/**
|
||||||
* Should this connection be used for receiving messages?
|
* Should this connection be used for receiving events?
|
||||||
*/
|
*/
|
||||||
read: boolean
|
read: boolean
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user