Singleton pattern of TypeScript