Skip to content

Commit

Permalink
fix(Realtime): Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kosssi committed May 7, 2019
1 parent 6614972 commit 1c1a028
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/cozy-realtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ class CozyRealtime {
constructor(cozyClient) {
this._cozyClient = cozyClient

this._updateSocketAuthentication = this._updateSocketAuthentication.bind(this)
this._updateSocketAuthentication = this._updateSocketAuthentication.bind(
this
)
this.unsubscribeAll = this.unsubscribeAll.bind(this)
this._receiveMessage = this._receiveMessage.bind(this)
this._receiveError = this._receiveError.bind(this)
Expand Down Expand Up @@ -131,11 +133,13 @@ class CozyRealtime {
_resubscribe() {
this._retryDelay = this._retryDelay * 2

const subscribeList = Object.keys(this._events).map(key => {
if (!key.includes(INDEX_KEY_SEPARATOR)) return
const [ type, eventName, id ] = key.split(INDEX_KEY_SEPARATOR)
return { type, id }
}).filter(Boolean)
const subscribeList = Object.keys(this._events)
.map(key => {
if (!key.includes(INDEX_KEY_SEPARATOR)) return
const [type, , id] = key.split(INDEX_KEY_SEPARATOR)
return { type, id }
})
.filter(Boolean)

for (const { type, id } of subscribeList) {
this._socket.subscribe(type, id)
Expand Down

0 comments on commit 1c1a028

Please sign in to comment.