import { InstanceOf } from "../.." ; /**
 * It create on instance of a classe and store it globaly using
 * the singleton design pattern
 */ export class DIService { private static _instance : DIService ; static get instance ( ) { if ( ! this . _instance ) { this . _instance = new DIService ( ) ; } return this . _instance ; } private _services : Map < any , InstanceType < any > > = new Map ( ) ; addService < ClassType > ( classType ) { const instance = new ( classType as any ) ( ) ; this . _services . set ( classType , instance ) ; return instance ; } getService < ClassType > ( classType ) { return this . _services . get ( classType ) ; } }