mirror of
https://github.com/Start9Labs/patch-db.git
synced 2026-03-26 10:21:53 +00:00
extends hashmap
This commit is contained in:
committed by
Aiden McClelland
parent
88084f60a2
commit
cf43a9a83e
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user