import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { CommandType , MessageBus } from '../shared' ; import { BrowserCommandSubject , ServerCommandSubject } from './server-message-subject' ; @ Injectable ( ) export class ServerMessageBus extends MessageBus { constructor ( private fromServer , private fromBrowser ) { super ( ) ; } getCommands ( ) { return this . fromBrowser . asObservable ( ) ; } sendCommand ( command ) { this . fromServer . next ( command ) ; } }