1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-12 06:13:38 +00:00

Combined State (#7383)

* Introduce Combined State

* Cleanup Test

* Update Fakes

* Address PR Feedback

* Update libs/common/src/platform/state/implementations/default-active-user-state.ts

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>

* Prettier

* Get rid of ReplaySubject reference

---------

Co-authored-by: Matt Gibson <mgibson@bitwarden.com>
This commit is contained in:
Justin Baur
2024-01-04 16:30:20 -05:00
committed by GitHub
parent 312197b8c7
commit 5e11cb212d
13 changed files with 280 additions and 339 deletions

View File

@@ -1,5 +1,4 @@
import { UserId } from "../../../types/guid";
import { EncryptService } from "../../abstractions/encrypt.service";
import {
AbstractMemoryStorageService,
AbstractStorageService,
@@ -16,7 +15,6 @@ export class DefaultSingleUserStateProvider implements SingleUserStateProvider {
private cache: Record<string, SingleUserState<unknown>> = {};
constructor(
protected encryptService: EncryptService,
protected memoryStorage: AbstractMemoryStorageService & ObservableStorageService,
protected diskStorage: AbstractStorageService & ObservableStorageService,
) {}
@@ -42,7 +40,6 @@ export class DefaultSingleUserStateProvider implements SingleUserStateProvider {
return new DefaultSingleUserState<T>(
userId,
keyDefinition,
this.encryptService,
this.getLocation(keyDefinition.stateDefinition.storageLocation),
);
}