stashing to handle out-of-sequence revisions

This commit is contained in:
Matt Hill
2021-07-07 19:18:08 -06:00
committed by Aiden McClelland
parent 0cbdc781b0
commit bddbc850ab
4 changed files with 74 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ import { merge, Observable, of } from 'rxjs'
import { concatMap, finalize, tap } from 'rxjs/operators'
import { Source } from './source/source'
import { Store } from './store'
import { DBCache } from './types'
import { DBCache, Http } from './types'
export { Operation } from 'fast-json-patch'
@@ -11,9 +11,10 @@ export class PatchDB<T> {
constructor (
private readonly sources: Source<T>[],
private readonly http: Http<T>,
private readonly initialCache: DBCache<T>,
) {
this.store = new Store(this.initialCache)
this.store = new Store(this.http, this.initialCache)
}
sync$ (): Observable<DBCache<T>> {