mirror of
https://github.com/bitwarden/browser.git
synced 2025-02-08 00:01:28 +01:00
Consolidate definition of storage keys
This way, external teams need only look at one file (perhaps to be changed to a directory in the future) to completely define a new storage location
This commit is contained in:
parent
6c88677d70
commit
3f3045e3e5
@ -1,5 +1,3 @@
|
||||
// Export all established state definitions
|
||||
export * from "./state-definitions";
|
||||
// Export all established KeyDefinitions
|
||||
export * from "./key-definitions";
|
||||
export { DefaultGlobalStateProvider } from "./default-global-state.provider";
|
||||
|
@ -4,7 +4,9 @@ import { DeriveContext, DerivedStateDefinition } from "./derived-state-definitio
|
||||
import { StateDefinition } from "./state-definition";
|
||||
|
||||
/**
|
||||
*
|
||||
* KeyDefinitions describe the precise location to store data for a given piece of state.
|
||||
* The StateDefinition is used to describe the domain of the state, and the KeyDefinition
|
||||
* sub-divides that domain into specific keys.
|
||||
*/
|
||||
// TODO Import Purpose type
|
||||
export class KeyDefinition<T> {
|
||||
|
@ -2,9 +2,11 @@ import { FolderData } from "../../vault/models/data/folder.data";
|
||||
import { FolderView } from "../../vault/models/view/folder.view";
|
||||
|
||||
import { KeyDefinition } from "./key-definition";
|
||||
import { FOLDER_SERVICE_DISK, FOLDER_SERVICE_MEMORY } from "./state-definitions";
|
||||
import { StateDefinition } from "./state-definition";
|
||||
|
||||
// FolderService Keys
|
||||
// FolderService
|
||||
const FOLDER_SERVICE_DISK = new StateDefinition("folderService", "disk");
|
||||
const FOLDER_SERVICE_MEMORY = new StateDefinition("folderService", "memory");
|
||||
export const FOLDERS = KeyDefinition.record<FolderData>(
|
||||
FOLDER_SERVICE_DISK,
|
||||
"folders",
|
||||
|
@ -1,4 +0,0 @@
|
||||
import { StateDefinition } from "./state-definition";
|
||||
|
||||
export const FOLDER_SERVICE_DISK = new StateDefinition("FolderService", "disk");
|
||||
export const FOLDER_SERVICE_MEMORY = new StateDefinition("FolderService", "memory");
|
Loading…
Reference in New Issue
Block a user