Sep 6, 2022
This doesn't really have much to do with Typescript--it would work the same if you weren't using TS. ServiceLocator only helps some--you're still using es6 to import a specific implementation. It's better to use dependency injection to provide your dependencies, rather than have your classes reach out and grab them (even with the help of a serviceLocator).