socket-io.ts 449 B

123456789101112131415161718
  1. import { io } from 'socket.io-client'
  2. function getUserNotificationSocket (serverUrl: string, accessToken: string) {
  3. return io(serverUrl + '/user-notifications', {
  4. query: { accessToken }
  5. })
  6. }
  7. function getLiveNotificationSocket (serverUrl: string) {
  8. return io(serverUrl + '/live-videos')
  9. }
  10. // ---------------------------------------------------------------------------
  11. export {
  12. getUserNotificationSocket,
  13. getLiveNotificationSocket
  14. }