chore: add prettier and reformat lib

This commit is contained in:
waterplea
2022-07-24 17:53:24 +03:00
committed by Matt Hill
parent c7006e0eb2
commit 2fef1e572c
12 changed files with 2600 additions and 112 deletions

View File

@@ -1,16 +1,18 @@
import { Observable } from 'rxjs'
import { webSocket, WebSocketSubject, WebSocketSubjectConfig } from 'rxjs/webSocket'
import {
webSocket,
WebSocketSubject,
WebSocketSubjectConfig,
} from 'rxjs/webSocket'
import { Update } from '../types'
import { Source } from './source'
export class WebsocketSource<T> implements Source<T> {
private websocket$: WebSocketSubject<RPCResponse<Update<T>>> | undefined
constructor (
private readonly url: string,
) { }
constructor(private readonly url: string) {}
watch$ (): Observable<RPCResponse<Update<T>>> {
watch$(): Observable<RPCResponse<Update<T>>> {
const fullConfig: WebSocketSubjectConfig<RPCResponse<Update<T>>> = {
url: this.url,
openObserver: {
@@ -48,7 +50,7 @@ class RpcError {
message: string
details: string
constructor (e: RPCError['error']) {
constructor(e: RPCError['error']) {
this.code = e.code
this.message = e.message
this.details = e.data.details