mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Prettier 2.0 (#393)
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import { configContext } from "../ConfigContext";
|
||||
import { IResourceProviderClientFactory, IResourceProviderClient } from "./IResourceProviderClient";
|
||||
import { ResourceProviderClient } from "./ResourceProviderClient";
|
||||
|
||||
export class ResourceProviderClientFactory implements IResourceProviderClientFactory<any> {
|
||||
private armEndpoint: string;
|
||||
private cachedClients: { [url: string]: IResourceProviderClient<any> } = {};
|
||||
|
||||
constructor() {
|
||||
this.armEndpoint = configContext.ARM_ENDPOINT;
|
||||
}
|
||||
|
||||
public getOrCreate(url: string): IResourceProviderClient<any> {
|
||||
if (!url) {
|
||||
throw new Error("No resource provider client factory params specified");
|
||||
}
|
||||
if (!this.cachedClients[url]) {
|
||||
this.cachedClients[url] = new ResourceProviderClient(this.armEndpoint);
|
||||
}
|
||||
return this.cachedClients[url];
|
||||
}
|
||||
}
|
||||
import { configContext } from "../ConfigContext";
|
||||
import { IResourceProviderClientFactory, IResourceProviderClient } from "./IResourceProviderClient";
|
||||
import { ResourceProviderClient } from "./ResourceProviderClient";
|
||||
|
||||
export class ResourceProviderClientFactory implements IResourceProviderClientFactory<any> {
|
||||
private armEndpoint: string;
|
||||
private cachedClients: { [url: string]: IResourceProviderClient<any> } = {};
|
||||
|
||||
constructor() {
|
||||
this.armEndpoint = configContext.ARM_ENDPOINT;
|
||||
}
|
||||
|
||||
public getOrCreate(url: string): IResourceProviderClient<any> {
|
||||
if (!url) {
|
||||
throw new Error("No resource provider client factory params specified");
|
||||
}
|
||||
if (!this.cachedClients[url]) {
|
||||
this.cachedClients[url] = new ResourceProviderClient(this.armEndpoint);
|
||||
}
|
||||
return this.cachedClients[url];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user