Last active
October 20, 2016 09:15
-
-
Save wmathes/bd0317709ebf982c2eb6fd215c409540 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ServiceNode { | |
constructor(protected client: HttpApiClient) { | |
} | |
} | |
class Service { | |
protected client: ServiceClient; | |
constructor(config: string | ServiceClient) { | |
if (typeof config === "string") { | |
this.client = new ServiceClient(config as String); | |
} | |
else if (!(config instanceof ServiceClient)) { | |
throw new Error("Requires an instance of ServiceClient or a string containing the services baseUrl"); | |
} | |
else { | |
this.client = config as ServiceClient; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment