mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-02 00:10:07 +02:00
websocket supported getter.
This commit is contained in:
parent
54f7514336
commit
6142c3baec
1 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,10 @@ export class NekoWebSocket extends EventEmitter<NekoWebSocketEvents> {
|
|||
this._log = new Logger('websocket')
|
||||
}
|
||||
|
||||
get supported() {
|
||||
return typeof WebSocket !== 'undefined' && WebSocket.OPEN === 1
|
||||
}
|
||||
|
||||
get connected() {
|
||||
return typeof this._ws !== 'undefined' && this._ws.readyState === WebSocket.OPEN
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue