socket-io-command.ts 459 B

123456789101112131415
  1. import { io } from 'socket.io-client'
  2. import { AbstractCommand, OverrideCommandOptions } from '../shared'
  3. export class SocketIOCommand extends AbstractCommand {
  4. getUserNotificationSocket (options: OverrideCommandOptions = {}) {
  5. return io(this.server.url + '/user-notifications', {
  6. query: { accessToken: options.token ?? this.server.accessToken }
  7. })
  8. }
  9. getLiveNotificationSocket () {
  10. return io(this.server.url + '/live-videos')
  11. }
  12. }