Skip to content

Commit

Permalink
feat(modules): udpate create function name to match fit nest terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcdo29 committed Nov 9, 2019
1 parent f6eba82 commit d3eae4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/modules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ and wait for the installation to finish.
Creating a new dynamic module is now easier than ever, all that is needed is the module's name, the options that are to be provided for the module, and a constant string, symbol, or token that is to be used for providing the options through injection. Following the idea of a non-global `ConfigModule`, you can do something like the following:

```ts
import { MakeConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { createConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { Module } from '@nestjs/common';
import { CONFIG_MODULE_OPTIONS } from './config.constants'; // the constant string/symbol/token
import { ConfigModuleOptions } from './config.options'; // the options to provide to the service
Expand All @@ -53,7 +53,7 @@ import { ConfigModule } from './config.service'; // the service to be provided t
providers: [ConfigService],
exports: [ConfigService]
})
export class ConfigModule extends MakeConfigurableDynamicRootModule<
export class ConfigModule extends createConfigurableDynamicRootModule<
ConfigModule,
ConfigModuleOptions
>(CONFIG_MODULE_OPTIONS) {}
Expand Down Expand Up @@ -95,7 +95,7 @@ export class ConfigModuleDependentModule {}
if you don't like the idea of calling `externallyConfigured` every time, you can create a `static` property on the Dynamic Module and set it equal to the `externallyConfigured` method. Take the above `ConfigModule` example:

```ts
import { MakeConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { createConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { Module } from '@nestjs/common';
import { CONFIG_MODULE_OPTIONS } from './config.constants'; // the constant string/symbol/token
import { ConfigModuleOptions } from './config.options'; // the options to provide to the service
Expand All @@ -105,7 +105,7 @@ import { ConfigModule } from './config.service'; // the service to be provided t
providers: [ConfigService],
exports: [ConfigService]
})
export class ConfigModule extends MakeConfigurableDynamicRootModule<
export class ConfigModule extends createConfigurableDynamicRootModule<
ConfigModule,
ConfigModuleOptions
>(CONFIG_MODULE_OPTIONS) {
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/src/dynamicModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export interface IConfigurableDynamicRootModule<T, U> {
): Promise<DynamicModule>;
}

export function MakeConfigurableDynamicRootModule<T, U>(
export function createConfigurableDynamicRootModule<T, U>(
moduleConfigToken: InjectionToken,
moduleProperties: Partial<
Pick<ModuleMetadata, 'imports' | 'exports' | 'providers'>
Expand Down
4 changes: 2 additions & 2 deletions packages/rabbitmq/src/rabbitmq.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DiscoveryModule, DiscoveryService } from '@golevelup/nestjs-discovery';
import { MakeConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { createConfigurableDynamicRootModule } from '@golevelup/nestjs-modules';
import { DynamicModule, Logger, Module, OnModuleInit } from '@nestjs/common';
import { ExternalContextCreator } from '@nestjs/core/helpers/external-context-creator';
import { groupBy } from 'lodash';
Expand All @@ -11,7 +11,7 @@ import { RabbitHandlerConfig, RabbitMQConfig } from './rabbitmq.interfaces';
imports: [DiscoveryModule]
})
export class RabbitMQModule
extends MakeConfigurableDynamicRootModule<RabbitMQModule, RabbitMQConfig>(
extends createConfigurableDynamicRootModule<RabbitMQModule, RabbitMQConfig>(
RABBIT_CONFIG_TOKEN,
{
providers: [
Expand Down

0 comments on commit d3eae4a

Please sign in to comment.