Skip to content

Instantly share code, notes, and snippets.

@tomisme
Created November 3, 2017 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomisme/14c0ad34244c11c7b345b59b8b8071c0 to your computer and use it in GitHub Desktop.
Save tomisme/14c0ad34244c11c7b345b59b8b8071c0 to your computer and use it in GitHub Desktop.
type Constructor<T> = new (...args: any[]) => T;
const servicesMap = new Map();
servicesMap.set(ImsItemPanelService, imsItemPanelService);
servicesMap.set(OverviewService, overviewService);
servicesMap.set(HelpPanelService, helpPanelService);
export function getService<T>(ClassName: Constructor<T>): T {
return servicesMap.get(ClassName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment