revert source connection monitor

This commit is contained in:
Matt Hill
2021-09-01 14:27:09 -06:00
committed by Aiden McClelland
parent c03c876098
commit c3e28cb683
4 changed files with 0 additions and 9 deletions

View File

@@ -22,8 +22,4 @@ export class PatchDB<T> {
concatMap(() => of(this.store.cache)), concatMap(() => of(this.store.cache)),
) )
} }
connectionMade$ (): Observable<void> {
return merge(...this.sources.map(s => s.connectionMade$))
}
} }

View File

@@ -9,7 +9,6 @@ export type PollConfig = {
} }
export class PollSource<T> implements Source<T> { export class PollSource<T> implements Source<T> {
connectionMade$ = new Subject<void>()
constructor ( constructor (
private readonly pollConfig: PollConfig, private readonly pollConfig: PollConfig,
@@ -37,7 +36,6 @@ export class PollSource<T> implements Source<T> {
return polling$.pipe( return polling$.pipe(
switchMap(_ => poll$), switchMap(_ => poll$),
concatMap(res => { concatMap(res => {
this.connectionMade$.next()
if (Array.isArray(res)) { if (Array.isArray(res)) {
return from(res) // takes Revision[] and converts it into Observable<Revision> return from(res) // takes Revision[] and converts it into Observable<Revision>
} else { } else {

View File

@@ -4,5 +4,4 @@ import { Update } from '../types'
export interface Source<T> { export interface Source<T> {
watch$ (store?: Store<T>): Observable<Update<T>> watch$ (store?: Store<T>): Observable<Update<T>>
connectionMade$: Observable<void>
} }

View File

@@ -5,7 +5,6 @@ import { Source } from './source'
export class WebsocketSource<T> implements Source<T> { export class WebsocketSource<T> implements Source<T> {
private websocket$: WebSocketSubject<Update<T>> | undefined private websocket$: WebSocketSubject<Update<T>> | undefined
connectionMade$ = new Subject<void>()
constructor ( constructor (
private readonly url: string, private readonly url: string,
@@ -16,7 +15,6 @@ export class WebsocketSource<T> implements Source<T> {
url: this.url, url: this.url,
openObserver: { openObserver: {
next: () => { next: () => {
this.connectionMade$.next()
this.websocket$!.next(document.cookie as any) this.websocket$!.next(document.cookie as any)
}, },
}, },