We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5ff844 commit c4d209cCopy full SHA for c4d209c
src/angular2-websocket.ts
@@ -29,6 +29,7 @@ export class $WebSocket {
29
private onErrorCallbacks = [];
30
private onCloseCallbacks = [];
31
private readyStateConstants = {
32
+ 'UNINITIALIZED': -1,
33
'CONNECTING': 0,
34
'OPEN': 1,
35
'CLOSING': 2,
@@ -322,13 +323,9 @@ export class $WebSocket {
322
323
324
}
325
- /**
326
- * Could be -1 if not initzialized yet
327
- * @returns {number}
328
- */
329
getReadyState() {
330
if (this.socket == null) {
331
- return -1;
+ return this.readyStateConstants.UNINITIALIZED;
332
333
return this.internalConnectionState || this.socket.readyState;
334
0 commit comments