mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
* refactor: introduce @bitwarden/serialization * refactor: introduce @bitwarden/guid * refactor: introduce @bitwaren/client-type * refactor: introduce @bitwarden/core-test-utils * refactor: introduce @bitwarden/state and @bitwarden/state-test-utils Creates initial project structure for centralized application state management. Part of modularization effort to extract state code from common. * Added state provider documentation to README. * Changed callouts to Github format. * Fixed linting on file name. * Forced git to accept rename --------- Co-authored-by: Todd Martin <tmartin@bitwarden.com>
14 lines
478 B
TypeScript
14 lines
478 B
TypeScript
import { GlobalState } from "./global-state";
|
|
import { KeyDefinition } from "./key-definition";
|
|
|
|
/**
|
|
* A provider for getting an implementation of global state scoped to the given key.
|
|
*/
|
|
export abstract class GlobalStateProvider {
|
|
/**
|
|
* Gets a {@link GlobalState} scoped to the given {@link KeyDefinition}
|
|
* @param keyDefinition - The {@link KeyDefinition} for which you want the state for.
|
|
*/
|
|
abstract get<T>(keyDefinition: KeyDefinition<T>): GlobalState<T>;
|
|
}
|