@fluojs/notifications 1.0.0-beta.1 → 1.0.0-beta.2
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.ko.md +4 -1
- package/README.md +4 -1
- package/package.json +3 -3
package/README.ko.md
CHANGED
|
@@ -71,8 +71,9 @@ export class AppModule {}
|
|
|
71
71
|
import { Inject } from '@fluojs/core';
|
|
72
72
|
import { NotificationsService } from '@fluojs/notifications';
|
|
73
73
|
|
|
74
|
+
@Inject(NotificationsService)
|
|
74
75
|
export class WelcomeService {
|
|
75
|
-
constructor(
|
|
76
|
+
constructor(private readonly notifications: NotificationsService) {}
|
|
76
77
|
|
|
77
78
|
async sendWelcomeEmail(userId: string, email: string) {
|
|
78
79
|
await this.notifications.dispatch({
|
|
@@ -88,6 +89,8 @@ export class WelcomeService {
|
|
|
88
89
|
}
|
|
89
90
|
```
|
|
90
91
|
|
|
92
|
+
`NotificationsModule.forRoot(...)`는 `NotificationsService`, `NOTIFICATIONS`, `NOTIFICATION_CHANNELS`를 global provider로 export합니다. 애플리케이션 서비스는 fluo의 class-level `@Inject(...)` decorator로 의존성을 선언해야 standard-decorator DI container가 legacy parameter decorator 없이 서비스를 resolve할 수 있습니다.
|
|
93
|
+
|
|
91
94
|
## 일반적인 패턴
|
|
92
95
|
|
|
93
96
|
### 큐 기반 대량 전달
|
package/README.md
CHANGED
|
@@ -71,8 +71,9 @@ export class AppModule {}
|
|
|
71
71
|
import { Inject } from '@fluojs/core';
|
|
72
72
|
import { NotificationsService } from '@fluojs/notifications';
|
|
73
73
|
|
|
74
|
+
@Inject(NotificationsService)
|
|
74
75
|
export class WelcomeService {
|
|
75
|
-
constructor(
|
|
76
|
+
constructor(private readonly notifications: NotificationsService) {}
|
|
76
77
|
|
|
77
78
|
async sendWelcomeEmail(userId: string, email: string) {
|
|
78
79
|
await this.notifications.dispatch({
|
|
@@ -88,6 +89,8 @@ export class WelcomeService {
|
|
|
88
89
|
}
|
|
89
90
|
```
|
|
90
91
|
|
|
92
|
+
`NotificationsModule.forRoot(...)` exports `NotificationsService`, `NOTIFICATIONS`, and `NOTIFICATION_CHANNELS` as global providers. Application services should declare dependencies with fluo's class-level `@Inject(...)` decorator so the standard-decorator DI container can resolve the service without legacy parameter decorators.
|
|
93
|
+
|
|
91
94
|
## Common Patterns
|
|
92
95
|
|
|
93
96
|
### Queue-backed bulk delivery
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"event-bus",
|
|
10
10
|
"channels"
|
|
11
11
|
],
|
|
12
|
-
"version": "1.0.0-beta.
|
|
12
|
+
"version": "1.0.0-beta.2",
|
|
13
13
|
"private": false,
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"repository": {
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fluojs/core": "^1.0.0-beta.1",
|
|
40
|
-
"@fluojs/di": "^1.0.0-beta.
|
|
41
|
-
"@fluojs/runtime": "^1.0.0-beta.
|
|
40
|
+
"@fluojs/di": "^1.0.0-beta.2",
|
|
41
|
+
"@fluojs/runtime": "^1.0.0-beta.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "^3.2.4"
|