MCPcopy Index your code
hub / github.com/angular/angular / resetDb

Function resetDb

packages/misc/angular-in-memory-web-api/src/backend-service.ts:723–737  ·  view source on GitHub ↗

* Tell your in-mem "database" to reset. * returns Observable of the database because resetting it could be async

(reqInfo?: RequestInfo)

Source from the content-addressed store, hash-verified

721 * returns Observable of the database because resetting it could be async
722 */
723 protected resetDb(reqInfo?: RequestInfo): Observable<boolean> {
724 this.dbReadySubject && this.dbReadySubject.next(false);
725 const db = this.inMemDbService.createDb(reqInfo);
726 const db$ =
727 db instanceof Observable
728 ? db
729 : typeof (db as any).then === 'function'
730 ? from(db as Promise<any>)
731 : of(db);
732 db$.pipe(first()).subscribe((d: {}) => {
733 this.db = d;
734 this.dbReadySubject && this.dbReadySubject.next(true);
735 });
736 return this.dbReady;
737 }
738}

Callers

nothing calls this directly

Calls 4

firstFunction · 0.85
createDbMethod · 0.80
subscribeMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…