'Use normal es6 classes with NestJS and access any service
When I have a nestjs app, everything is seperated into modules, controllers and services. But what I am actually looking for, is a way to instantiate as many classes of a certain type which then have access to a modules service for example.
I want to "spawn" classes on the go to act like a worker, executing tasks on repeat. Is this even possible with NestJS or cant I use normal classes to interact with NestJS services?
For example ModuleA has ServiceA, serviceA created a bunch of objects of SampleClass which have access to ServiceA methods.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
