diff options
author | Richard Macklin <richard.github@nrm.com> | 2019-01-14 11:35:04 -0800 |
---|---|---|
committer | Richard Macklin <richard.github@nrm.com> | 2019-01-14 11:35:04 -0800 |
commit | 6320916513891938f7d2f0b5c9c36968ee2d8705 (patch) | |
tree | 986965d8b9eb7cd3b0592dad07fd7b31e56a3ba2 /actioncable/app/javascript/action_cable/index.js | |
parent | dbe073aebf198493a1a162d314c49dfcd5dbbf1b (diff) | |
download | rails-6320916513891938f7d2f0b5c9c36968ee2d8705.tar.gz rails-6320916513891938f7d2f0b5c9c36968ee2d8705.tar.bz2 rails-6320916513891938f7d2f0b5c9c36968ee2d8705.zip |
Simplify ActionCable.getConfig, Connection#getProtocol, and Connection#close
by relying on the implicit undefined return value
Diffstat (limited to 'actioncable/app/javascript/action_cable/index.js')
-rw-r--r-- | actioncable/app/javascript/action_cable/index.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actioncable/app/javascript/action_cable/index.js b/actioncable/app/javascript/action_cable/index.js index ddcd4dcebc..659418396f 100644 --- a/actioncable/app/javascript/action_cable/index.js +++ b/actioncable/app/javascript/action_cable/index.js @@ -24,7 +24,9 @@ export function createConsumer(url = getConfig("url") || INTERNAL.default_mount_ export function getConfig(name) { const element = document.head.querySelector(`meta[name='action-cable-${name}']`) - return (element ? element.getAttribute("content") : undefined) + if (element) { + return element.getAttribute("content") + } } export function createWebSocketURL(url) { |