2021-12-03 03:32:58 +01:00
|
|
|
import { Injectable } from "@angular/core";
|
2018-06-08 23:08:19 +02:00
|
|
|
|
2023-06-06 22:34:53 +02:00
|
|
|
import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service";
|
|
|
|
import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service";
|
2018-06-08 23:08:19 +02:00
|
|
|
|
2021-12-03 03:32:58 +01:00
|
|
|
@Injectable()
|
2018-06-08 23:08:19 +02:00
|
|
|
export class BroadcasterMessagingService implements MessagingService {
|
|
|
|
constructor(private broadcasterService: BroadcasterService) {}
|
|
|
|
|
|
|
|
send(subscriber: string, arg: any = {}) {
|
|
|
|
const message = Object.assign({}, { command: subscriber }, arg);
|
|
|
|
this.broadcasterService.send(message);
|
|
|
|
}
|
|
|
|
}
|