mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
websocket supported getter.
This commit is contained in:
parent
54f7514336
commit
6142c3baec
@ -21,6 +21,10 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
|
|||||||
this._log = new Logger('websocket')
|
this._log = new Logger('websocket')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get supported() {
|
||||||
|
return typeof WebSocket !== 'undefined' && WebSocket.OPEN === 1
|
||||||
|
}
|
||||||
|
|
||||||
get connected() {
|
get connected() {
|
||||||
return typeof this._ws !== 'undefined' && this._ws.readyState === WebSocket.OPEN
|
return typeof this._ws !== 'undefined' && this._ws.readyState === WebSocket.OPEN
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user