Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
123456789101112131415161718192021// Action Cable provides the framework to deal with WebSockets in Rails.// You can generate new channels where WebSocket features live using the `rails generate channel` command.
import { createConsumer } from "@rails/actioncable"import { getAccessToken } from '../token'
const consumer = createConsumer(getWebsocketURL)
function getWebsocketURL() { const token = getAccessToken() let url = '/api/cable' if (token) { url += `?access_token=${token}` }
return url
}
export default consumer