1
0
Fork 0
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:
Joe 2021-04-26 15:21:46 -04:00 committed by GitHub
parent ba1ec19013
commit dcff2f27ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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}`
}