Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
When configuring the ScheduleModule settings, like the cronJobs param, I would like to use a value of my ConfigService. With the current forRoot method, it is not possible to access an instance of the ConfigService.
Describe the solution you'd like
Other (native) NestJS modules provide a method forRootAsync, which allows importing and injecting the ConfigService to consume its values for setting up the module.
Teachability, documentation, adoption, migration strategy
Example usage:
ScheduleModule.forRootAsync({
  imports: [ConfigModule],
  inject: [ConfigService],
  useFactory: (configService: ConfigService<AppConfig>) => ({
    cronJobs: configService.get('ENABLE_CRON_JOBS', { infer: true }),
  }),
}), 
What is the motivation / use case for changing the behavior?
Implementing/fixing this
- Allows for a cleaner module setup using a single source of truth.
 
- Aligns the API with many other NestJS modules.