mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix javascript syntax
This commit is contained in:
parent
ba1ec19013
commit
dcff2f27ca
1 changed files with 2 additions and 2 deletions
|
@ -266,9 +266,9 @@ WebSocket is opened.
|
|||
createConsumer('https://ws.example.com/cable')
|
||||
|
||||
// Use a function to dynamically generate the URL
|
||||
createConsumer(getWebSocketURL)
|
||||
createConsumer(getWebSocketURL())
|
||||
|
||||
function getWebSocketURL {
|
||||
function getWebSocketURL() {
|
||||
const token = localStorage.get('auth-token')
|
||||
return `https://ws.example.com/cable?token=${token}`
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue