diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index c87a2eacfc5..835b568c8cb 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -156,6 +156,12 @@ export class AppComponent implements OnInit, OnDestroy { window.onkeypress = () => this.recordActivity(); }); + /// ############ DEPRECATED ############ + /// Please do not use the AppComponent to send events between services. + /// + /// Services that depends on other services, should do so through Dependency Injection + /// and subscribe to events through that service observable. + /// this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { this.ngZone.run(async () => { switch (message.command) { diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index e3e93840e15..feea3c5de8e 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -98,6 +98,12 @@ export class AppComponent implements OnDestroy, OnInit { window.onkeypress = () => this.recordActivity(); }); + /// ############ DEPRECATED ############ + /// Please do not use the AppComponent to send events between services. + /// + /// Services that depends on other services, should do so through Dependency Injection + /// and subscribe to events through that service observable. + /// this.broadcasterService.subscribe(BroadcasterSubscriptionId, async (message: any) => { this.ngZone.run(async () => { switch (message.command) { diff --git a/libs/common/src/abstractions/broadcaster.service.ts b/libs/common/src/abstractions/broadcaster.service.ts index 9d080d03632..5df3c033433 100644 --- a/libs/common/src/abstractions/broadcaster.service.ts +++ b/libs/common/src/abstractions/broadcaster.service.ts @@ -2,8 +2,20 @@ export interface MessageBase { command: string; } +/** + * @deprecated Use the observable from the appropriate service instead. + */ export abstract class BroadcasterService { + /** + * @deprecated Use the observable from the appropriate service instead. + */ send: (message: MessageBase, id?: string) => void; + /** + * @deprecated Use the observable from the appropriate service instead. + */ subscribe: (id: string, messageCallback: (message: MessageBase) => void) => void; + /** + * @deprecated Use the observable from the appropriate service instead. + */ unsubscribe: (id: string) => void; }