Skip to content

Commit

Permalink
feat: remove forFeature until i figure out how to implement it correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
bassochette committed Mar 8, 2022
1 parent a54813b commit 9de02d8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,7 @@ export class AppModule {}

## Usage

```ts
import { Module } from '@nestjs/common';
import { RedisModule } from '@webeleon/nestjs-redis';

@Module({
imports: [
RedisModule.forFeature()
]
})
export class FeatureModule {}
```
This package is globally providing `REDIS_CLIENT`

```ts
import { Injectable } from '@nestjs/common';
Expand Down
16 changes: 0 additions & 16 deletions src/redis/redis.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,6 @@ export class RedisModule {
};
}

public static forFeature(): DynamicModule {
return {
module: RedisModule,
providers: [
RedisProvider,
{
provide: REDIS_CLIENT,
useFactory: async (redisProvider: RedisProvider) =>
await redisProvider.getClient(),
inject: [RedisProvider],
},
],
exports: [REDIS_CLIENT],
};
}

private static createConfigProviders(
options: RedisModuleAsyncOptions
): Provider {
Expand Down

0 comments on commit 9de02d8

Please sign in to comment.