mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 00:41:31 +00:00
Refactor Global state into Context Files (#128)
This commit is contained in:
20
src/UserContext.ts
Normal file
20
src/UserContext.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { DatabaseAccount } from "./Contracts/DataModels";
|
||||
|
||||
interface UserContext {
|
||||
masterKey?: string;
|
||||
subscriptionId?: string;
|
||||
resourceGroup?: string;
|
||||
databaseAccount?: DatabaseAccount;
|
||||
endpoint?: string;
|
||||
accessToken?: string;
|
||||
authorizationToken?: string;
|
||||
resourceToken?: string;
|
||||
}
|
||||
|
||||
const userContext: Readonly<UserContext> = {} as const;
|
||||
|
||||
function updateUserContext(newContext: UserContext): void {
|
||||
Object.assign(userContext, newContext);
|
||||
}
|
||||
|
||||
export { userContext, updateUserContext };
|
||||
Reference in New Issue
Block a user