NestJS: Use a solo @injectable class as a singleton Provider
Published in
2 min readMar 18, 2022
Intro
NestJS Modules are Singletons by default. Their Providers are also singletons when they are provided from within the same module. However, there are cases where we want to use just a single solo class as a provider to a couple or more modules. In such cases, we can use the solo class as singleton or not. Let’s see how we can do that.