@adimm/x-injection 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -5
- package/dist/index.cjs +188 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -80
- package/dist/index.d.ts +141 -80
- package/dist/index.js +168 -118
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -26,6 +26,7 @@ xInjection <a href="https://www.npmjs.com/package/@adimm/x-injection" targe
|
|
|
26
26
|
- [Dynamic Exports](#dynamic-exports)
|
|
27
27
|
- [Advanced Usage](#advanced-usage)
|
|
28
28
|
- [Documentation](#documentation)
|
|
29
|
+
- [ReactJS Implementation](#reactjs-implementation)
|
|
29
30
|
- [Contributing](#contributing)
|
|
30
31
|
|
|
31
32
|
## Overview
|
|
@@ -126,6 +127,7 @@ The below list shows them in order of priority _(highest to lowest)_, meaning th
|
|
|
126
127
|
3. By providing the [defaultScope](https://adimarianmutu.github.io/x-injection/interfaces/ProviderModuleOptions.html#defaultscope) property when initializing a `ProviderModule`:
|
|
127
128
|
```ts
|
|
128
129
|
const RainModule = new ProviderModule({
|
|
130
|
+
identifier: Symbol('RainModule'),
|
|
129
131
|
defaultScope: InjectionScope.Transient,
|
|
130
132
|
});
|
|
131
133
|
```
|
|
@@ -152,7 +154,7 @@ export class SessionService {
|
|
|
152
154
|
}
|
|
153
155
|
|
|
154
156
|
export const DatabaseModule = new ProviderModule({
|
|
155
|
-
|
|
157
|
+
identifier: Symbol('DatabaseModule'),
|
|
156
158
|
providers: [DatabaseService],
|
|
157
159
|
exports: [DatabaseService],
|
|
158
160
|
onReady: async (module) => {
|
|
@@ -168,7 +170,7 @@ export const DatabaseModule = new ProviderModule({
|
|
|
168
170
|
});
|
|
169
171
|
|
|
170
172
|
export const SessionModule = new ProviderModule({
|
|
171
|
-
|
|
173
|
+
identifier: Symbol('SessionModule'),
|
|
172
174
|
defaultScope: InjectionScope.Request,
|
|
173
175
|
providers: [SessionService],
|
|
174
176
|
exports: [SessionService],
|
|
@@ -244,7 +246,7 @@ class CrowService extends AnimalService {
|
|
|
244
246
|
}
|
|
245
247
|
|
|
246
248
|
const AnimalModule = new ProviderModule({
|
|
247
|
-
|
|
249
|
+
identifier: Symbol('AnimalModule'),
|
|
248
250
|
providers: [AnimalService, { provide: WingsService, useClass: WingsService, scope: InjectionScope.Transient }],
|
|
249
251
|
exports: [AnimalService, WingsService],
|
|
250
252
|
dynamicExports: (importerModule, moduleExports) => {
|
|
@@ -260,14 +262,14 @@ const AnimalModule = new ProviderModule({
|
|
|
260
262
|
});
|
|
261
263
|
|
|
262
264
|
const CrowModule = new ProviderModule({
|
|
263
|
-
|
|
265
|
+
identifier: Symbol('CrowModule'),
|
|
264
266
|
imports: [AnimalModule],
|
|
265
267
|
providers: [CrowService],
|
|
266
268
|
exports: [CrowService],
|
|
267
269
|
});
|
|
268
270
|
|
|
269
271
|
const CatModule = new ProviderModule({
|
|
270
|
-
|
|
272
|
+
identifier: Symbol('CatModule'),
|
|
271
273
|
imports: [AnimalModule],
|
|
272
274
|
providers: [CatService],
|
|
273
275
|
exports: [CatService],
|
|
@@ -308,6 +310,12 @@ Comprehensive, auto-generated documentation is available at:
|
|
|
308
310
|
|
|
309
311
|
👉 [https://adimarianmutu.github.io/x-injection/index.html](https://adimarianmutu.github.io/x-injection/index.html)
|
|
310
312
|
|
|
313
|
+
## ReactJS Implementation
|
|
314
|
+
|
|
315
|
+
You want to use it within a [ReactJS](https://react.dev/) project? Don't worry, the library does already have an official implementation for React ⚛️
|
|
316
|
+
|
|
317
|
+
For more details check out the [GitHub Repository](https://github.com/AdiMarianMutu/x-injection-reactjs).
|
|
318
|
+
|
|
311
319
|
## Contributing
|
|
312
320
|
|
|
313
321
|
Pull requests are warmly welcomed! 😃
|