1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

Prefer get methods to return single user states unless specified active (#7834)

* Prefer get methods to return single user states unless specified active

* Improve comment
This commit is contained in:
Matt Gibson
2024-02-08 12:02:48 -05:00
committed by GitHub
parent 4be25e3df3
commit 2525a3707f
4 changed files with 52 additions and 32 deletions

View File

@@ -22,6 +22,9 @@ export abstract class StateProvider {
/**
* Gets a state observable for a given key and userId.
*
* @remarks If userId is falsy the observable returned will point to the currently active user _and not update if the active user changes_.
* This is different to how `getActive` works and more similar to `getUser` for whatever user happens to be active at the time of the call.
*
* @param keyDefinition - The key definition for the state you want to get.
* @param userId - The userId for which you want the state for. If not provided, the state for the currently active user will be returned.
*/