mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-30 03:51:56 +00:00
chore: small tweaks
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
import { Observable } from 'rxjs'
|
import { Observable } from 'rxjs'
|
||||||
import { webSocket, WebSocketSubject } from 'rxjs/webSocket'
|
import { webSocket } from 'rxjs/webSocket'
|
||||||
import { Update } from '../types'
|
import { Update } from '../types'
|
||||||
import { Source } from './source'
|
import { Source } from './source'
|
||||||
|
|
||||||
export class WebsocketSource<T> implements Source<T> {
|
export class WebsocketSource<T> implements Source<T> {
|
||||||
private websocket$: WebSocketSubject<RPCResponse<Update<T>>> = webSocket({
|
private websocket$ = webSocket<RPCResponse<Update<T>>>({
|
||||||
url: this.url,
|
url: this.url,
|
||||||
openObserver: {
|
openObserver: {
|
||||||
next: () => {
|
next: () => {
|
||||||
@@ -15,7 +15,8 @@ export class WebsocketSource<T> implements Source<T> {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly url: string,
|
private readonly url: string,
|
||||||
private readonly document: Document,
|
// TODO: Remove fallback after client app is updated
|
||||||
|
private readonly document: Document = document,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
watch$(): Observable<RPCResponse<Update<T>>> {
|
watch$(): Observable<RPCResponse<Update<T>>> {
|
||||||
|
|||||||
Reference in New Issue
Block a user