react to sequnce changes

This commit is contained in:
Matt Hill
2021-07-06 21:53:49 -06:00
committed by Aiden McClelland
parent c4fa205c3d
commit 2255089484
8 changed files with 40 additions and 32 deletions

View File

@@ -18,6 +18,7 @@ export enum ConnectionStatus {
})
export class PatchDbModel {
connectionStatus$ = new BehaviorSubject(ConnectionStatus.Initializing)
sequence$: Observable<number>
data: DataModel
private patchDb: PatchDB<DataModel>
private patchSub: Subscription
@@ -30,6 +31,8 @@ export class PatchDbModel {
async init (): Promise<void> {
const cache = await this.bootstrapper.init()
this.patchDb = new PatchDB(this.sources, cache)
this.sequence$ = this.patchDb.store.sequence$.asObservable()
this.data = this.patchDb.store.cache.data
}