mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 02:11:54 +00:00
revert source connection monitor
This commit is contained in:
@@ -22,8 +22,4 @@ export class PatchDB<T> {
|
||||
concatMap(() => of(this.store.cache)),
|
||||
)
|
||||
}
|
||||
|
||||
connectionMade$ (): Observable<void> {
|
||||
return merge(...this.sources.map(s => s.connectionMade$))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ export type PollConfig = {
|
||||
}
|
||||
|
||||
export class PollSource<T> implements Source<T> {
|
||||
connectionMade$ = new Subject<void>()
|
||||
|
||||
constructor (
|
||||
private readonly pollConfig: PollConfig,
|
||||
@@ -37,7 +36,6 @@ export class PollSource<T> implements Source<T> {
|
||||
return polling$.pipe(
|
||||
switchMap(_ => poll$),
|
||||
concatMap(res => {
|
||||
this.connectionMade$.next()
|
||||
if (Array.isArray(res)) {
|
||||
return from(res) // takes Revision[] and converts it into Observable<Revision>
|
||||
} else {
|
||||
|
||||
@@ -4,5 +4,4 @@ import { Update } from '../types'
|
||||
|
||||
export interface Source<T> {
|
||||
watch$ (store?: Store<T>): Observable<Update<T>>
|
||||
connectionMade$: Observable<void>
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import { Source } from './source'
|
||||
|
||||
export class WebsocketSource<T> implements Source<T> {
|
||||
private websocket$: WebSocketSubject<Update<T>> | undefined
|
||||
connectionMade$ = new Subject<void>()
|
||||
|
||||
constructor (
|
||||
private readonly url: string,
|
||||
@@ -16,7 +15,6 @@ export class WebsocketSource<T> implements Source<T> {
|
||||
url: this.url,
|
||||
openObserver: {
|
||||
next: () => {
|
||||
this.connectionMade$.next()
|
||||
this.websocket$!.next(document.cookie as any)
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user