Skip to content

Commit 9333f86

Browse files
authored
address pr feedback
change if statement to ternary, use const for consistency, add spacing after ternary expression
1 parent c7ca85e commit 9333f86

File tree

1 file changed

+2
-6
lines changed
  • actioncable/app/javascript/action_cable

1 file changed

+2
-6
lines changed

actioncable/app/javascript/action_cable/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,8 @@ export function getConfig(name) {
3030
}
3131

3232
export function createWebSocketURL(url) {
33-
let webSocketURL
34-
if (typeof url === 'function') {
35-
webSocketURL = url()
36-
} else {
37-
webSocketURL = url
38-
}
33+
const webSocketURL = typeof url === 'function' ? url() : url;
34+
3935
if (webSocketURL && !/^wss?:/i.test(webSocketURL)) {
4036
const a = document.createElement("a")
4137
a.href = webSocketURL

0 commit comments

Comments
 (0)