You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2021. It is now read-only.
Add support for module imports using forFeature method in addition to forRoot. This adds the ability for multiple instances of InMemoryDBService to be registered each with differing configurations.
Closes#59
Copy file name to clipboardExpand all lines: README.md
+50-1Lines changed: 50 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ To get started, let's first update our `app.module.ts` to include the necessary
39
39
40
40
> While we are importing to the AppModule in this example, InMemoryDBModule could be imported in Feature modules just as well.
41
41
42
+
#### Registering a forRoot InMemoryDBService
43
+
42
44
```typescript
43
45
// app.module.ts
44
46
@@ -48,7 +50,7 @@ import { InMemoryDBModule } from '@nestjs-addons/in-memory-db';
48
50
49
51
@Module({
50
52
...
51
-
imports: [InMemoryDBModule.forRoot()],
53
+
imports: [InMemoryDBModule.forRoot({})],
52
54
...
53
55
})
54
56
exportclassAppModule {}
@@ -102,6 +104,53 @@ export class UserController {
102
104
}
103
105
```
104
106
107
+
## Feature Modules - Registering Multiple Instances using `forFeature`
108
+
109
+
Registering multiple instances for specific feature modules is super simple. Each feature module is guaranteed isolated to that feature. In order to get up and running you need to do the following:
0 commit comments