import { Observable, timeout } from 'rxjs' import { webSocket } from 'rxjs/webSocket' import { Update } from '../types' import { Source } from './source' export class WebsocketSource implements Source { constructor(private readonly url: string) {} watch$(): Observable> { return webSocket>(this.url).pipe(timeout({ first: 60000 })) } }