1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

Remove memory storage cache from derived state. Use observable cache and port messaging (#8939)

This commit is contained in:
Matt Gibson
2024-04-26 15:08:39 -04:00
committed by GitHub
parent b3242145f9
commit 089f251a0c
19 changed files with 83 additions and 294 deletions

View File

@@ -16,9 +16,11 @@ export class ObservableTracker<T> {
/**
* Awaits the next emission from the observable, or throws if the timeout is exceeded
* @param msTimeout The maximum time to wait for another emission before throwing
* @returns The next emission from the observable
* @throws If the timeout is exceeded
*/
async expectEmission(msTimeout = 50) {
await firstValueFrom(
async expectEmission(msTimeout = 50): Promise<T> {
return await firstValueFrom(
this.observable.pipe(
timeout({
first: msTimeout,