extends hashmap

This commit is contained in:
Drew Ansbacher
2021-07-21 14:47:38 -06:00
committed by Matt Hill
parent 37ad3091bd
commit 7f7f7b6503
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import { Source } from './source/source'
import { Store } from './store'
import { DBCache, HashMap, Http } from './types'
export class PatchDB<T> {
export class PatchDB<T extends HashMap> {
store: Store<T>
constructor (
@@ -15,7 +15,7 @@ export class PatchDB<T> {
this.store = new Store(this.http, this.initialCache)
}
sync$ (): Observable<DBCache<HashMap>> {
sync$ (): Observable<DBCache<T>> {
return merge(...this.sources.map(s => s.watch$(this.store)))
.pipe(
tap(update => this.store.update(update)),