Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 43x 43x 43x 1429x 1714x 136x 1278x 1277x 1277x 1x 2x 2x 2x | import { DocumentStore } from '../types';
import { EMPTY, Observable, of } from 'rxjs';
import { InMemoryStore } from './InMemoryStore';
export class InMemoryDocumentStore<T> extends InMemoryStore implements DocumentStore<T> {
#doc: T | null = null;
get(): Observable<T> {
if (!this.#doc || this.destroyed) return EMPTY;
return of(this.#doc);
}
set(doc: T): Observable<void> {
if (!this.destroyed) {
this.#doc = doc;
return of(void 0);
}
return EMPTY;
}
delete(): Observable<void> {
Iif (this.destroyed) return EMPTY;
this.#doc = null;
return of(void 0);
}
}
|