From 7f7f7b650337bd2b01c8b09ad78ca147d09b5782 Mon Sep 17 00:00:00 2001 From: Drew Ansbacher Date: Wed, 21 Jul 2021 14:47:38 -0600 Subject: [PATCH] extends hashmap --- client/lib/patch-db.ts | 4 ++-- client/lib/store.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/lib/patch-db.ts b/client/lib/patch-db.ts index 9f79056..de96130 100644 --- a/client/lib/patch-db.ts +++ b/client/lib/patch-db.ts @@ -4,7 +4,7 @@ import { Source } from './source/source' import { Store } from './store' import { DBCache, HashMap, Http } from './types' -export class PatchDB { +export class PatchDB { store: Store constructor ( @@ -15,7 +15,7 @@ export class PatchDB { this.store = new Store(this.http, this.initialCache) } - sync$ (): Observable> { + sync$ (): Observable> { return merge(...this.sources.map(s => s.watch$(this.store))) .pipe( tap(update => this.store.update(update)), diff --git a/client/lib/store.ts b/client/lib/store.ts index 4580766..7035244 100644 --- a/client/lib/store.ts +++ b/client/lib/store.ts @@ -8,8 +8,8 @@ export interface StashEntry { undo: Operation[] } -export class Store { - cache: DBCache +export class Store { + cache: DBCache sequence$: BehaviorSubject private watchedNodes: { [path: string]: BehaviorSubject } = { } private stash = new BTree()