diff options
author | Javan Makhmali <javan@javan.us> | 2016-02-19 10:24:17 -0500 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2016-02-23 09:37:49 -0600 |
commit | ab28276713af8503b667ecbc8c1672c187e944d7 (patch) | |
tree | 1db2f8d60a2c65e1907a42982f1665e176cde2ed /actioncable/app/assets/javascripts/action_cable | |
parent | 96118db3354553399754600fabe21468b13c078a (diff) | |
download | rails-ab28276713af8503b667ecbc8c1672c187e944d7.tar.gz rails-ab28276713af8503b667ecbc8c1672c187e944d7.tar.bz2 rails-ab28276713af8503b667ecbc8c1672c187e944d7.zip |
Connection#isAlive
Diffstat (limited to 'actioncable/app/assets/javascripts/action_cable')
-rw-r--r-- | actioncable/app/assets/javascripts/action_cable/connection.coffee | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actioncable/app/assets/javascripts/action_cable/connection.coffee b/actioncable/app/assets/javascripts/action_cable/connection.coffee index b1343a111c..78028bda3c 100644 --- a/actioncable/app/assets/javascripts/action_cable/connection.coffee +++ b/actioncable/app/assets/javascripts/action_cable/connection.coffee @@ -16,7 +16,7 @@ class ActionCable.Connection false open: => - if @webSocket and not @isClosed() + if @isAlive() console.log("[cable] Attemped to open WebSocket, but existing socket is #{@getState()}", Date.now()) throw new Error("Existing connection must be closed before opening") else @@ -44,8 +44,8 @@ class ActionCable.Connection # Private - isClosed: -> - @isState("closing", "closed") + isAlive: -> + not @isState("closing", "closed") isState: (states...) -> @getState() in states |