Skip to content

Commit

Permalink
cleanup for v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnsolo committed Apr 28, 2017
1 parent 8bea9b3 commit 9d47e59
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
const https = require('https')
const Promise = require('promise')
const WebSocket = require('ws')
const EventEmitter = require('events').EventEmitter;
const EventEmitter = require('events').EventEmitter

const TOKEN_EXPIRATION_INTERVAL = 1000 * 60 * 60 * 24 * 7 // 1 week
const HEARTBEAT_INTERVAL = 1000 * 20 // 20 seconds
Expand All @@ -15,6 +15,8 @@ const WS_PROTOCOL = "wss"

class IntrinioRealtime extends EventEmitter {
constructor(options) {
super()

this.options = options
this.token = null
this.websocket = null
Expand Down Expand Up @@ -68,20 +70,20 @@ class IntrinioRealtime extends EventEmitter {
}

_throw(e) {
let handled = false;
let handled = false
if (typeof e === 'string') {
e = "IntrinioRealtime | " + e
}
if (typeof this.error_callback === 'function') {
this.error_callback(e)
handled = true;
handled = true
}
if (this.listenerCount('error') > 0) {
this.emit('error', e);
handled = true;
this.emit('error', e)
handled = true
}
if (!handled) {
throw e;
throw e
}
}

Expand All @@ -97,13 +99,13 @@ class IntrinioRealtime extends EventEmitter {
})

this.afterConnected.done(() => {
this.emit('connect');
this.emit('connect')
this._stopSelfHeal()
if (rejoin) { this._rejoinChannels() }
},
() => {
this._trySelfHeal()
});
})

return this.afterConnected
}
Expand Down Expand Up @@ -188,7 +190,7 @@ class IntrinioRealtime extends EventEmitter {
if (typeof this.quote_callback === 'function') {
this.quote_callback(quote)
}
this.emit('quote', quote);
this.emit('quote', quote)
this._debug('Quote: ', quote)
}
else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "intrinio-realtime",
"version": "1.0.0",
"version": "1.0.1",
"engines": {
"node" : ">=6.9.5"
},
Expand Down

0 comments on commit 9d47e59

Please sign in to comment.