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 | 41x 41x 41x 1309x 1342x 11x 1243x 1242x 1242x 1x | 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; } } |