1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-19 01:33:33 +00:00

Allow common get and set operations from state providers (#7824)

* Allow common get and set operations from state providers

* Use finnish endings for observables
This commit is contained in:
Matt Gibson
2024-02-06 11:35:22 -05:00
committed by GitHub
parent cc88826be4
commit 166269520c
8 changed files with 189 additions and 7 deletions

View File

@@ -1,3 +1,5 @@
import { Observable } from "rxjs";
import { UserId } from "../../types/guid";
import { KeyDefinition } from "./key-definition";
@@ -18,6 +20,10 @@ export abstract class SingleUserStateProvider {
* to the currently active user
*/
export abstract class ActiveUserStateProvider {
/**
* Convenience re-emission of active user ID from {@link AccountService.activeAccount$}
*/
activeUserId$: Observable<UserId | undefined>;
/**
* Gets a {@link ActiveUserState} scoped to the given {@link KeyDefinition}, but updates when active user changes such
* that the emitted values always represents the state for the currently active user.