Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
change if statement to ternary, use const for consistency, add spacing after ternary expression
  • Loading branch information
audiolion authored Mar 9, 2019
1 parent c7ca85e commit 9333f86
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions actioncable/app/javascript/action_cable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ export function getConfig(name) {
}

export function createWebSocketURL(url) {
let webSocketURL
if (typeof url === 'function') {
webSocketURL = url()
} else {
webSocketURL = url
}
const webSocketURL = typeof url === 'function' ? url() : url;

if (webSocketURL && !/^wss?:/i.test(webSocketURL)) {
const a = document.createElement("a")
a.href = webSocketURL
Expand Down

0 comments on commit 9333f86

Please sign in to comment.